Currency after amount (toString) isn't idiomatic everywhere.
paul-hammant opened this issue · 4 comments
## Simple conversion to a string
final money = Money(150, Currency('USD'));
print(money.toString()); // => 1.50 USD
Need facility to represent as USD $1.50
, and alternately $1.50
.
Brazil is more complex:
As is now in this lib: 1.50 BRL
(nobody writes 'Reis' like that in Brazil.
Should be: R$1.50
(how people write amound of reis in Brazil)
Workaround is to string-replace the result from money.toString()
stripping the BRL suffix, and prepending R$
.
Formatting/parsing of string representation is missing in this library. I can't give you any promise about that. But you can implement own formatter/parser for your project.
toString()
just provides debug information, nothing else. I would not recommend to depend on format returned by toString()
.
Honestly, design of this library is bad. Maybe one day we will make a new release with better design, it depends on internal needs of our company.
Honestly, design of this library is bad. Maybe one day we will make a new
release with better design, it depends on internal needs of our company.
Maybe a warning on the README that others should not depend on this lib for production applications.
There is not problem with production, but API of this library may be not convenient for your application.
This is the defacto standard for Dart+Flutter. I guess as long as you're good a chomping through Pull-Requests then you don't have to code it yourselves. Take a look at https://github.com/gorakhargosh/watchdog for a dire warning. 137 open issues and 20 unconsumed pull requests. Luckily there's a competing effort now - https://github.com/samuelcolvin/watchgod - with a chance to not become mired in the same maintainer hell.