Formatting an integer in a script

I have the following script:

  • results.each(function(index) {
  • var field, result = “”;
  • field = record.tables[“detail”][index].fields[“Extended_Price___Display_ID235”];
  • if (field !== “”) result += formatter.currencyNoSymbol(field);
  • this.html(result);
  • });

The output has parentheses for negative values: (96.58). How can I format the output so that the output has a negative sign: -96.58.

Can you check in your regional settings in Windows to see what the Negative Number Format is set to? It’s under the Additional Settings button in the Region window.

Mine is set to -1.1 and that formatter.currencyNoSymbol(field); function is returning a -2.00 when my datafield is equal to -2

Hi AlbertsN, I have the same problem. The regional configuration is the same as the one you describe, however it brings me the negative values ??with (). Is there any script to be able to replace them?

By default, the configuration will use your system locale, but you may have changed it at some point, not realizing. Double check your locale settings to be sure you’re using the System locale instead of something else.

More information about the locale and the methods it impacts can be found here: PlanetPress Connect 1.6.1 User Guide