Hi, thanks for a great library!
I'm working on a system that's dealing with both fiat currencies and a couple of cryptocurrencies and I thought I could easily build a Locale object to describe common crypto formats (all decimal places, symbol after the number, etc)
I have this:
var cryptos = map[string]accounting.Locale{
"USDC": {
Name: "USD Coin",
FractionLength: 11,
ThouSep: ",",
DecSep: ".",
SpaceSep: " ",
UTFSymbol: "",
HTMLSymbol: "",
ComSymbol: "USDC",
Pre: false,
},
}
But then I realised, the actual formatting API doesn't accept some of these parameters, most importantly Pre which I wanted to use to place the symbol after the value, which seems to be the consensus around crypto currency value formatting:
For example.
It seems this could be implemented in the formatMoneyString function if Accounting had a Pre field.
Though, it also begs the question, why not just embed Locale into Accounting?
Anyway, would be happy to submit a PR for formatMoneyString!
Hi, thanks for a great library!
I'm working on a system that's dealing with both fiat currencies and a couple of cryptocurrencies and I thought I could easily build a
Localeobject to describe common crypto formats (all decimal places, symbol after the number, etc)I have this:
But then I realised, the actual formatting API doesn't accept some of these parameters, most importantly
Prewhich I wanted to use to place the symbol after the value, which seems to be the consensus around crypto currency value formatting:For example.
It seems this could be implemented in the
formatMoneyStringfunction ifAccountinghad aPrefield.Though, it also begs the question, why not just embed
LocaleintoAccounting?Anyway, would be happy to submit a PR for
formatMoneyString!