Hello @mishrackant
Thank you very much for using our plugin. You can use the toLocaleString
method.
For example, assuming you have the equation fieldname1+fieldname2
, and you want to return the result in Indian system, you can edit it as follows:
(fieldname1+fieldname2).toLocaleString('hi-IN')
Now, How to transform a value in Indian system to a valid javascript number to use in mathematical operations?
For example, assuming the fieldname1 is in Indian System, and you want to use it in a mathematical operation, like fieldname1*3
You can implement the equation as follows:
(function(){
var field = parseFloat((fieldname1|r).replace(/[^\d\.]/g, ''));
return field*3;
})()
Note the use of the |r
modifier with the field’s name. The plugin extracts numbers from fields values before evaluating the equations to use them in mathematical operations. But in your case, the default extraction of the plugin is not a solution. You need to get the field’s raw value to process it yourself. The |r
modifier gives you access the field’s raw value, without preprocessing.
If you want to the previous equation returns the value in Indian System, you can edit it as follows:
(function(){
var field = parseFloat((fieldname1|r).replace(/[^\d\.]/g, ''));
return (field*3).toLocaleString('hi-IN');
})()
Best regards.