Skip to content

Added support for Decimal places in JSON marshall - #124

Closed
IvRRimum wants to merge 2 commits into
shopspring:masterfrom
IvRRimum:master
Closed

IvRRimum wants to merge 2 commits into
shopspring:masterfrom
IvRRimum:master

Conversation

@IvRRimum

Copy link
Copy Markdown

This seems super usefull.

Basically allows user to set how many numbers after decimal to return(and rounds up).
Using StringFixed.

Thanks!

@adevjoe

adevjoe commented Nov 17, 2018

Copy link
Copy Markdown

It is usefull for me. I have the same implementation.No one accepts it?

@adevjoe adevjoe left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please accept it

@theoribeiro

Copy link
Copy Markdown

Sorry to bring up a zombie 6 year old PR back but any chance something like this might be accepted @mwoss?

@curiousDeividas

Copy link
Copy Markdown

@adevjoe this configuration option would be highly appreciated.

@mwoss

mwoss commented Oct 18, 2026

Copy link
Copy Markdown
Member

Thanks @IvRRimum, and everyone who upvoted! A global setting would round every decimal in the program, including rates and quantities, not only prices. A small wrapper type does this per field today, and #475 adds that to the README FAQ. We also plan to ship such wrapper types in the library in 2.0, for fixed decimal places and for JSON numbers. Closing this one.

@mwoss mwoss closed this Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants