Skip to main content

Search

How to do calculations when using comma for decimal notation?

Answered

Comments

2 comments

  • RosarioM

    Hello Fernando,

    We advise to make the following steps:

    1. Open form in Design mode
    2. Go to Behaviour tab, and click on Edit Button in Form Load Actions Group
    3. Click Add Action and select "Execute Script" for property Type
    Insert next code into an editor:
    var numberFormat = Sys.CultureInfo.CurrentCulture.numberFormat;
    var setFakeSeparators = function(){
      numberFormat.CurrencyGroupSeparator = "FakeGroupSeparator";
      numberFormat.CurrencyDecimalSeparator = "FakeDecimalSeparator";
    };
    setFakeSeparators();

    if(!Number.originalParseLocale){
      Number.originalParseLocale = Number.parseLocale;
      Number.parseLocale = function(value){
        numberFormat.CurrencyGroupSeparator = ".";
        numberFormat.CurrencyDecimalSeparator = ",";
        var result = Number.originalParseLocale(value);
        setFakeSeparators();
        return result;
      }
    }
    4.Click save.
    5. Then user should modify his expression. He need to open Expression Builder for his cell or field.
    6. Set Expression type to Function  Code
    and modify his expression like follow:
     var result = <some calculation logic>;
    return result.toString().replace(".", ",");
    where instead of <some calculation logic> should be his expression
     e.g video http://take.ms/murRr
    Note: This works only for locales where decimal separator is "," and group separator "."
    e.g. spain, danish
     If you change to regional setting e.g. to English it will work wrong.

     

    Hope these steps help you.

    Thank you

     

    Best Regards

    Rosario Matos

     

     

     

    0
  • Matthias_Walter

    Hi Fernando,

    the latest version has a bugfix for this problem.

    Get it from here: /hc/en-us/articles/360012061120-skybow-Rich-Forms-Version-3-1-0-2

    0

Please sign in to leave a comment.