Using it-IT in language settings results in crazy numbers in fluoro detail

Issue #693 resolved
Ed McDonagh
created an issue

Summary box has missing numbers and numbers that are many orders of magnitude too large, likewise for event doses.

Not tested yet but assumed to affect all languages that use a comma for decimal marker.

Comments (23)

  1. Ed McDonagh reporter

    There are numbers missing on the filtered list pages too if it-IT is used.

    @David Platten, @Luuk, anyone, if you fancy working out what is going on and you might get there sooner than me, please do! Otherwise I'll see if I can work it out later.

  2. Luuk

    I got a bit nervous as I'm living in a country that uses a comma for decimal marker. The server I'm running OpenREM on is set like this in Windows, but imports seem fine (and also summary boxes are fine). Or do you mean the language code in settings.py? In the settings.py the language code is not changed in my case (so still on 'en-us').

  3. Ed McDonagh reporter

    This will get the right number on the page, but we'd end up with a mix of comma and decimal separators for the European localisations:

    {% load l10n %}
    <script>document.write({{ accum_integrated.dose_rp_total|unlocalize }}.toPrecision(3));</script>
    

    Thoughts anyone?

  4. Luuk

    I didn't test it, but would

    <script>document.write({{ accum_integrated.dose_rp_total | floatformat:3 }});</script>
    

    do the trick? So use the Django functionality instead of the java toPrecision?

  5. Ed McDonagh reporter

    Perfect. I'll give it a try later - if we can use that then we can drop all the javascript formatting :-) However, it might fall foul of the commas too, we'll have to have a look.

  6. Log in to comment