decimal
decimal copied to clipboard
NewFromString: Thousands Separator on Input
the string $8,112.61
breaks for me.
I am hesitant to open this given that the $
is already not supported.
Should FromString
variants handle string formatters?
Maybe strip out $
/,
characters?
Hesitant to preemptively submit a PR given i18n implications, ie comma meaning fractional vs purely formatting in European countries.
Open to feedback, and submit PR for s/[$,]//g
filtering if that's reasonable and aligned with the project goals.
Thanks!
Also, only found one other related issue, #98, though I believe that issue is for formatting output whereas this is for handling formatted input
Hi @coip. Thanks for suggesting such functionality.
Tbh, I'm not convinced of the necessity of handling money formatted string by FromString
method.
Anyways, I'm aware that decimal libs are mostly used for money operations, so we will consider implementing this. (FYI. @njason)
I'm not convinced of the necessity
I don’t blame ya. It is a bit out of the scope given the use-case specificity. Maybe considering it more broadly, as a FromFormattedString
for example, would help it be more applicable for a ~parsing suite.
we will consider implementing this.
Appreciate it, if I find some bandwidth I will try to open a feasible pr but that’s honestly not v likely at the moment.
NewFromFormattedString would be a better idea, IMO. We will add this task to backlog ;)