Numberformat

From SMTX Wiki
Jump to navigation Jump to search

In 'default values', set the field as 'contains calculations' and add this

  FORMAT('{0:0.00}', TONUMBER('#REPLACE-FORMFIELD-DateChecks||roundnumber||#'))

The example above will transfer any number to a number with 2 digits after the decimal seperator, example:

12121211212.12212 becomes =>  12121211212.12

To force to show the thousands seperator , with 2 digits after the decimal seperator

 format('{0:N2}',##)

To force to show the thousands seperator , with 0 digits after the decimal seperator

 format('{0:N0}',

To show the number with decimal & thousands seperators, and leave blank without any entry, with 2 digits after the decimal seperator Note: the 2 single quotes at the end gives the alternative input, so in this case it remains empty when nothing is entered. View this page in EDIT mode to see the quotes !!!

 FORMAT('{0:N2}', tonumber('#REPLACE-FORMFIELD-Numbers example||Amount_02||#', ))


To show the number with decimal & thousands seperators, and leave blank without any entry, with 5 digits after the decimal seperator Note: the 2 single quotes at the end gives the alternative input, so in this case it remains empty when nothing is entered. View this page in EDIT mode to see the quotes !!!

 FORMAT('{0:N5}', tonumber('#REPLACE-FORMFIELD-Numbers example||Amount_02||#', ))

To show a number, without thousands seperator, but with 2 digits after the comma (decimal seperator):

 FORMAT('{0:f2}', ToNumber('##',0))