Moodle
  1. Moodle
  2. MDL-27748

The array values from question_bank::fraction_options should use localised numbers

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1, 2.3.7, 2.4.4, 2.5
    • Fix Version/s: 2.3.8, 2.4.5, 2.5.1
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      You need one course set to English, and another set to French. (Acutally the key point here is languages that use . or , as a decimal point.

      Create a multiple choice or short-answer question. Make sure the grade option drop-down uses the right sort of decimal points.

      Show
      You need one course set to English, and another set to French. (Acutally the key point here is languages that use . or , as a decimal point. Create a multiple choice or short-answer question. Make sure the grade option drop-down uses the right sort of decimal points.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull from Repository:
    • Pull 2.4 Branch:
    • Pull Master Branch:
    • Rank:
      17402

      Description

      The array values are destined for display to users, so they should be properly localised.

        Activity

        Hide
        Jayesh Anandani added a comment -

        Can i get a little bit help on the question please?

        Show
        Jayesh Anandani added a comment - Can i get a little bit help on the question please?
        Hide
        Tim Hunt added a comment -

        You need to realise that different cultures write numbers in different ways. For example in England we write 33.33333% In France they write 33,33333%. It gets quite complex. See http://en.wikipedia.org/wiki/Decimal_mark

        So, in Moodle, when we display a number to users, we should display it in the way they expect. Fortunately, there is a function format_float (defined in lib/moodlelib.php) which displays a number correctly. (It is a bit like get_string in some ways.)

        Show
        Tim Hunt added a comment - You need to realise that different cultures write numbers in different ways. For example in England we write 33.33333% In France they write 33,33333%. It gets quite complex. See http://en.wikipedia.org/wiki/Decimal_mark So, in Moodle, when we display a number to users, we should display it in the way they expect. Fortunately, there is a function format_float (defined in lib/moodlelib.php) which displays a number correctly. (It is a bit like get_string in some ways.)
        Hide
        Tim Hunt added a comment -

        Submitting for integration.

        Show
        Tim Hunt added a comment - Submitting for integration.
        Hide
        Dan Poltawski added a comment -

        Integrated to master, 25, 24, 23 - thanks Tim

        Show
        Dan Poltawski added a comment - Integrated to master, 25, 24, 23 - thanks Tim
        Hide
        Rossiani Wijaya added a comment -

        For master branch:
        Since the language pack for master is not available yet, I tested it by changing the 'decsep' string in langconfig file to use ','. It works as expected.

        Also tested for 2.3, 2.4 and 2.5, all work as expected.

        Test passed.

        Show
        Rossiani Wijaya added a comment - For master branch: Since the language pack for master is not available yet, I tested it by changing the 'decsep' string in langconfig file to use ','. It works as expected. Also tested for 2.3, 2.4 and 2.5, all work as expected. Test passed.
        Hide
        Damyon Wiese added a comment -

        Thanks for your contribution! This issue has been reviewed, integrated, tested and now released to everyone.

        Closing as Fixed!

        Show
        Damyon Wiese added a comment - Thanks for your contribution! This issue has been reviewed, integrated, tested and now released to everyone. Closing as Fixed!

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: