@Test public void testPercentageFunded() { assertEquals(50.0f, ProjectFactory.halfWayProject().percentageFunded()); assertEquals(100.0f, ProjectFactory.allTheWayProject().percentageFunded()); assertEquals(200.0f, ProjectFactory.doubledGoalProject().percentageFunded()); }
public float percentageFunded() { if (goal() > 0.0f) { return ((float) pledged() / (float) goal()) * 100.0f; } return 0.0f; }
Project implements Parcelable, Relay { public float percentageFunded() { if (goal() > 0.0f) { return ((float) pledged() / (float) goal()) * 100.0f; } return 0.0f; } }
Project implements Parcelable, Relay { public float percentageFunded() { if (goal() > 0.0f) { return ((float) pledged() / (float) goal()) * 100.0f; } return 0.0f; }  }
Project implements Parcelable, Relay { public float percentageFunded() { if (goal() > 0.0f) { return ((float) pledged() / (float) goal()) * 100.0f; } return 0.0f; }  abstract @Nullable List<String> availableCardTypes(); abstract int backersCount(); abstract String blurb(); abstract @Nullable Backing backing(); abstract @Nullable Category category(); abstract @Nullable Integer commentsCount(); abstract String country(); abstract DateTime createdAt(); abstract User creator(); abstract String currency(); abstract String currencySymbol(); abstract String currentCurrency(); abstract boolean currencyTrailingCode(); abstract @Nullable DateTime featuredAt(); abstract @Nullable List<User> friends(); abstract Float fxRate(); abstract @Nullable DateTime deadline(); abstract double goal(); abstract long id(); abstract boolean isBacking(); abstract boolean isStarred(); abstract @Nullable DateTime lastUpdatePublishedAt(); abstract @Nullable DateTime launchedAt(); abstract @Nullable Location location(); abstract String name(); abstract @Nullable List<Permission> permissions(); abstract double pledged(); abstract @Nullable Photo photo(); abstract @Nullable Boolean prelaunchActivated(); abstract @Nullable List<Reward> rewards(); abstract @Nullable String slug(); abstract @Nullable Boolean staffPick(); abstract @State String state(); abstract @Nullable DateTime stateChangedAt(); abstract Float staticUsdRate(); abstract @Nullable Integer unreadMessagesCount(); abstract @Nullable Integer unseenActivityCount(); abstract @Nullable Integer updatesCount(); abstract @Nullable DateTime updatedAt(); abstract Urls urls(); abstract @Nullable Video video(); static Builder builder(); abstract Builder toBuilder(); @NonNull String creatorBioUrl(); boolean isBackingRewardId(final long rewardId); @NonNull String descriptionUrl(); @NonNull String updatesUrl(); @NonNull String webProjectUrl(); boolean hasComments(); boolean hasRewards(); boolean hasVideo(); boolean isCanceled(); boolean isFailed(); boolean isFeaturedToday(); boolean isLive(); boolean isFriendBacking(); boolean isFunded(); boolean isPurged(); boolean isStarted(); boolean isSubmitted(); boolean isSuspended(); boolean isSuccessful(); boolean isApproachingDeadline(); float percentageFunded(); @NonNull String param(); @NonNull String secureWebProjectUrl(); @NonNull String newPledgeUrl(); @NonNull String editPledgeUrl(); @NonNull String rewardSelectedUrl(final @NonNull Reward reward); @Override final @NonNull String toString(); @Override final boolean equals(final @Nullable Object o); @Override final int hashCode(); }
Project implements Parcelable, Relay { public float percentageFunded() { if (goal() > 0.0f) { return ((float) pledged() / (float) goal()) * 100.0f; } return 0.0f; }  abstract @Nullable List<String> availableCardTypes(); abstract int backersCount(); abstract String blurb(); abstract @Nullable Backing backing(); abstract @Nullable Category category(); abstract @Nullable Integer commentsCount(); abstract String country(); abstract DateTime createdAt(); abstract User creator(); abstract String currency(); abstract String currencySymbol(); abstract String currentCurrency(); abstract boolean currencyTrailingCode(); abstract @Nullable DateTime featuredAt(); abstract @Nullable List<User> friends(); abstract Float fxRate(); abstract @Nullable DateTime deadline(); abstract double goal(); abstract long id(); abstract boolean isBacking(); abstract boolean isStarred(); abstract @Nullable DateTime lastUpdatePublishedAt(); abstract @Nullable DateTime launchedAt(); abstract @Nullable Location location(); abstract String name(); abstract @Nullable List<Permission> permissions(); abstract double pledged(); abstract @Nullable Photo photo(); abstract @Nullable Boolean prelaunchActivated(); abstract @Nullable List<Reward> rewards(); abstract @Nullable String slug(); abstract @Nullable Boolean staffPick(); abstract @State String state(); abstract @Nullable DateTime stateChangedAt(); abstract Float staticUsdRate(); abstract @Nullable Integer unreadMessagesCount(); abstract @Nullable Integer unseenActivityCount(); abstract @Nullable Integer updatesCount(); abstract @Nullable DateTime updatedAt(); abstract Urls urls(); abstract @Nullable Video video(); static Builder builder(); abstract Builder toBuilder(); @NonNull String creatorBioUrl(); boolean isBackingRewardId(final long rewardId); @NonNull String descriptionUrl(); @NonNull String updatesUrl(); @NonNull String webProjectUrl(); boolean hasComments(); boolean hasRewards(); boolean hasVideo(); boolean isCanceled(); boolean isFailed(); boolean isFeaturedToday(); boolean isLive(); boolean isFriendBacking(); boolean isFunded(); boolean isPurged(); boolean isStarted(); boolean isSubmitted(); boolean isSuspended(); boolean isSuccessful(); boolean isApproachingDeadline(); float percentageFunded(); @NonNull String param(); @NonNull String secureWebProjectUrl(); @NonNull String newPledgeUrl(); @NonNull String editPledgeUrl(); @NonNull String rewardSelectedUrl(final @NonNull Reward reward); @Override final @NonNull String toString(); @Override final boolean equals(final @Nullable Object o); @Override final int hashCode(); static final String STATE_STARTED; static final String STATE_SUBMITTED; static final String STATE_LIVE; static final String STATE_SUCCESSFUL; static final String STATE_FAILED; static final String STATE_CANCELED; static final String STATE_SUSPENDED; static final String STATE_PURGED; }