Commit graph

9 commits

Author SHA1 Message Date
Dave Collins
506d333934 Update btcutil import paths to new location. 2015-01-15 15:13:38 -06:00
Josh Rickmar
40ba1daf69 Add Amount.ToBTC convenience method.
Closes #26.
2015-01-02 09:19:16 -05:00
Josh Rickmar
e0adcd5f70 Make amount constants untyped.
Since these constants can be useful for int64, Amount, and float64
math, it doesn't make sense to make them just one type, and require
type conversions for the rest.

ok @davecgh
2014-07-08 11:13:12 -05:00
Dave Collins
6c4b5928ab goimports -w . 2014-07-02 19:29:48 -05:00
Josh Rickmar
2847c14f06 Add Amount.MulF64.
ok @davecgh, @jcvernaleo
2014-06-23 12:05:00 -05:00
Josh Rickmar
e622fde7e7 Remove bounds check for NewAmount.
Amount should still be a usable type even if the monetary amount being
described is not an amount at a single instance in time, for example,
the total of all BTC received by an address.  Therefore, the bounds
checks that the amount is within the total amount of bitcoin ever
producable have been removed.

The checks for NaN and +-Infinity remain.
2014-04-12 16:20:11 -05:00
Josh Rickmar
3a2bf60941 Rename AmountUnit constants.
Besides being shorter, using "BTC" rather than "Bitcoin" in the
AmountUnit constants is deemed to be better for these units as BTC is
already a recognized monetary unit.

AmountBaseBitcoin has likewise been renamed to AmountSatoshi as this
is consistant with how it is returned as a string.  The "standard"
part of the comment in the const block has been removed, as Satoshi is
technically not a standard term for this unit.

ok @davecgh
2014-04-11 23:23:27 -05:00
Josh Rickmar
80b1f232bc Make Amount a fmt.Stringer. 2014-04-11 23:16:41 -05:00
Josh Rickmar
fc6f0dee54 Add Amount type to represent a monetary value.
ok @davecgh
2014-04-11 22:43:47 -05:00