Back to project page TrackEveryPenny.
The source code is released under:
Apache License
If you think the Android project TrackEveryPenny listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package ca.jbrains.upfp.model; /*from w w w. j ava 2s .c om*/ public final class Amount { private final int cents; public Amount(int cents) { this.cents = cents; } public static Amount cents(int cents) { return new Amount(cents); } @Override public boolean equals(Object other) { if (other instanceof Amount) { final Amount that = (Amount) other; return this.cents == that.cents; } return false; } @Override public int hashCode() { return cents; } @Override public String toString() { return String.format("%1d cents", cents); } public double inDollars() { return cents / 100.0d; } }