Closed Dalvae closed 11 months ago
Our Next.js starter uses our medusa-react
to convert raw prices to a human-readable amount. Right now, it uses a hardcoded list of no-division currencies. We are aware that this is a sub-optimal way of handling it, but it's what we have to work with for now.
I am happy to accept a PR adding CLP to the list. Alternatively, you can use our utils in medusa-react
to handle the price displaying yourself following a similar approach as to what we do.
Update: I realise you are aware of the hardcoded list already. Let me know how you want to proceed from here, and I can help :)
Bug report
We are encountering an issue where Chilean Pesos (CLP) prices are being processed as decimal-based currencies in our application. As a zero-decimal currency, CLP should not be divided by 100, but currently, all CLP amounts are being treated this way, leading to incorrect price calculations and display. System information
Steps to reproduce the behavior
Expected behavior
For zero-decimal currencies like CLP, the amount should be treated as the smallest currency unit without conversion. Therefore, a price of 1000 CLP should be processed and displayed exactly as 1000 CLP, without being divided by 100.
Screenshots
This is the helper function, thanks to @VariableVic