• Resolved blueblast

    (@blueblast)


    How can I change the way the thousands separator commas appear? The default is 2,000,000 but I’d like to show it according to Indian numbering system of 20,00,000

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @blueblast,

    Our plugin does not implements the Indian number system, however, you can get the results with this numbers system easily in the calculated fields.

    I will try to explain the process with a simple example:

    Assuming your current equation is: fieldname1+fieldname2
    I’ll modify the equation to convert the result in a text, and apply the pattern:

    (function(){
    var result = fieldname1+fieldname2; 
    result = result.toString();
    return result.replace(/(\d)(?=(\d\d)+\d$)/g, "$1,");
    })()

    and that’s all.

    Please don’t forget indicate in the properties of the calculated field that your are using the comma symbol (,) as thousands separator.

    Best regards.

    Thread Starter blueblast

    (@blueblast)

    Where should I enter this code?

    Also, what about input fields that use currency type?

    Plugin Author codepeople

    (@codepeople)

    Hello @blueblast,

    The equations are entered through the “Set equation” attributes in the properties of calculated fields (https://cff.dwbooster.com/images/documentation/calculated-field-settings.png)

    About the currency fields, my recommendation would be insert a “HTML Content” field with the following piece of code as its content:

    <script>
    jQuery(document).on('change','.cff-currency-field input', function(){
    var val = this.value; 
    val = val.replace(/[^\.\d]/g,'');
    this.value = '$'+val.replace(/(\d)(?=(\d\d)+\d$)/g, "$1,");
    });
    </script>

    and that’s all.
    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Currency – thousands separator format’ is closed to new replies.