Thousand separator error

Thousand separator error

by Runar Sigurdsson -
Number of replies: 8

Hi my friends at Moodle.org

I get an error when I try to use comma in my question and I do need to use comma here in Iceland. I am an administrator of the system so I can change the system if needed. Please let me know if you have any thoughts on this matter.

The error is shown in the Answer.PNG picture and the question setup is shown in the question1.png

Regards, 
Rúnar Sigurðsson

Average of ratings: -
In reply to Runar Sigurdsson

Re: Thousand separator error

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It looks like you have the language set to English. (Judging by the fact that the error message is in English.) In English, , is not the decimal separator.

If you want English text, but with non-english decimal separator, the only way I can think of to achieve this is to make a new language pack en_commadecimal, or something like that. You should only need to create the langconfig.php part of the language pack, to say that the parent language is English, and what the decimal and thousands separators are.

See https://docs.moodle.org/dev/Starting_a_new_language_pack and https://docs.moodle.org/31/en/Language_packs


Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Thousand separator error

by Runar Sigurdsson -


Hi

I am actually using Icelandic. I just changed it to English so that you could read it.

In reply to Runar Sigurdsson

Re: Thousand separator error

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Well, https://lang.moodle.org/local/amos/view.php?t=1478079045&v=3100&l=is&c=langconfig&s&d seems to show that Icelandic has the right decimal separator set. Are you sure you get the same error is Icelandic? Can you check the https://docs.moodle.org/31/en/Language_customisation settings on your server, to see if someone has changed these strings?

In reply to Tim Hunt

Re: Thousand separator error

by Andrew Barrett -

Hi Tim,

1, We're in an unusual position that we'd like to accept either , or . as the decimal separator. Is this something we could do via the language pack?

2. Does your suggestion above require changing some of the code or is this simply a case of going into language customisation and changing a string?

Thanks

Andrew

In reply to Andrew Barrett

Re: Thousand separator error

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You can't do this just via the language pack. You would need to alter the actual code in qtype_numerical. (That code is also used by qtype_calculated.)

In reply to Tim Hunt

Re: Thousand separator error

by Andrew Barrett -

Thanks Tim. Always appreciate our input. 

One last query, is it something I could do (as fairly non-technical) or do I need to rope in a developer?