Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

use two decimals in input in giving knob #3966

Closed
chadwhitacre opened this issue Mar 15, 2016 · 4 comments
Closed

use two decimals in input in giving knob #3966

chadwhitacre opened this issue Mar 15, 2016 · 4 comments

Comments

@chadwhitacre
Copy link
Contributor

Raised on Twitter (cc: @JVimes). The issue is that we're using format_decimal there, and it doesn't know how to enforce two decimal places.

mbt9kdlwda

h6cri0ct3m

I think there may be other places we're afflicted by this as well? Maybe re: widgets?

@chadwhitacre
Copy link
Contributor Author

@mattbk
Copy link
Contributor

mattbk commented Mar 17, 2016

Maybe re: widgets?

I think I solved this in gratipay/grtp.co#118, but that's JS...

@aandis
Copy link
Contributor

aandis commented Apr 6, 2016

python-babel/babel#90

@etanol
Copy link

etanol commented Apr 7, 2016

I've seen this issue linked from python-babel/babel#90. You need to keep in mind that format_currency and format_decimal have different number patterns by default. Since you can specify an explicit number pattern, my advice is to to the following:

  1. Extract the default currency pattern of the locale in use
  2. Remove the currency symbols from it: ¤
  3. Use the result as an explicit pattern to either format_decimal or format_currency

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants