Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-1295

Usage of $mathtool.toDouble() is dangerous

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 6.2
    • Fix Version/s: None
    • Component/s: Velocity
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      $mathtool.toDouble("2.1")
      

      returns "2.1" when the English locale is set, but "2" when the French locale is used.

      Sometimes it could be nice to have this conversion in the locale of the server, but sometimes the developer did not expect it and it creates a bug (see XWIKI-11343).

      This function is locale dependent, and we have no way yo manually set the locale.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              surli Simon Urli
              Reporter:
              gdelhumeau Guillaume Delhumeau
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: