Replies: 5 comments 3 replies
-
Please provide more information about what you are trying to do. Are you writing a report template? Or a plugin? What currency information are you currently trying to render? |
Beta Was this translation helpful? Give feedback.
-
it rounds up after the comma I think. decimal places are supposed to be
rendered after a "." in CAD currency. isn't there any way to just bypass
any config from the app itself. It just does not render the same anywhere
and it does not display null values in decimal places (ex: 1 instead of
1.00)
here is when it's set up at 2:
[image: image.png]
[image: image.png]
then, here is when it's at 3:
[image: image.png]
at 4:
[image: image.png]
here is an example from PO's when the value is at 5:
[image: image.png]
…On Thu, Mar 16, 2023 at 12:46 AM Oliver ***@***.***> wrote:
Please provide more information about what you are trying to do. Are you
writing a report template? Or a plugin? What currency information are you
currently trying to render?
—
Reply to this email directly, view it on GitHub
<#4498 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOXZLLUSP6VT7SRPJVSKHH3W4KLIVANCNFSM6AAAAAAV4VT3CU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
@anonkwe I think that the code is working as intended. I have checked different decimal places options locally, and in all the cases I checked it was working as I would expect. The Examples below:
Essentially, trailing zeroes are not rendered. Hope this clears things up? |
Beta Was this translation helpful? Give feedback.
-
currencies should roundup at 2 decimals %.2f (##,###.00) as it is by
default everywhere.. but there is no way to get this done partly because of
the pricing setting and the bunch of rounded decimal values in the code
…On Fri, Mar 24, 2023 at 06:57 Oliver ***@***.***> wrote:
@anonkwe <https://github.com/anonkwe> I think that the code is working as
intended. I have checked different decimal places options locally, and in
all the cases I checked it was working as I would expect.
The PRICING_DECIMAL_PLACES setting determines the *maximum* number of
decimal places to render when displaying a currency. If there are *fewer*
decimal places available, they are *not* rendered.
Examples below:
Value 3 Places 5 Places
1.23456789 1.235 1.23457
4.44444444 4.444 4.44444
1.1111 1.111 1.1111
1.23 1.23 1.23
1.2000 1.2 1.2
7 7 7
Essentially, trailing zeroes are not rendered. Hope this clears things up?
—
Reply to this email directly, view it on GitHub
<#4498 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOXZLLW56LAUUUGDV4ONXVTW5V4YHANCNFSM6AAAAAAV4VT3CU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I have raised a new issue for this - #4526 And a PR to fix it: #4527 You can also refer to the documentation to see how to render currency in a report: https://docs.inventree.org/en/latest/report/helpers/#rendering-currency |
Beta Was this translation helpful? Give feedback.
-
is there a way to globalize any format currency through django or python or anything ? We need to have the right decimals related to our locale and currency. but the option [PRICING_DECIMAL_PLACES] from the app is messing rendering a good amount of modules... is there a way to globalize it or bypass this setting at all?
Beta Was this translation helpful? Give feedback.
All reactions