Closed lukechampine closed 4 months ago
I'm okay with the change to String()
, but I'm against the removal of ExactString()
.
Personally, I'd rather have String()
return the value in hastings. All code works with hastings and a Currency
represents a number of hastings, not Siacoin.
fair enough, restored.
I've also tweaked UnmarshalText
to accept strings with units. This not only benefits weirdos like me who write JSON transactions by hand, but also anyone using Currency values in a human-readable config format (e.g. a YAML file specifying host prices? idk)
We discussed removing the SI units as well, and using SC exclusively (i.e. the example above would be
2.529378333356156158367 mS
), but there was less consensus on that.Since
String
is now exact,ExactString
has been removed; if you want raw Hastings values, you can useBig
orfmt.Sprintf("%d", c)
. If you want a rounded value, you can use standard approaches to round thefloat64
returned bySiacoins
.