Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 9.4   9.5   10.0   10.1   10.2   10.3   10.4   10.5   11.0   11.1    Statistic    FMM    Blog  

Math.FormatNumber

Formats a number.

Component Version macOS Windows Linux Server FileMaker iOS SDK
Math 11.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Math.FormatNumber"; Value { ; Digits; Decimal Separator; Thousands Separator } )   More

Parameters

Parameter Description Example Flags
Value The number to format. 123
Digits Number of digits.
Can be zero when there should be no digits after decimal separator.
Default is zero. Maxium 12. Values are rounded.
3 Optional
Decimal Separator The decimal separator.
If empty, we detect the current setting from FileMaker.
Can also be explicitly given as "." or ",".
"." Optional
Thousands Separator The thousands separator.
Can be empty.
If you pass dot or comma and the same character is used for decimal separator, we switch to the other.
Optional

Result

Returns OK or error.

Description

Formats a number.
We format the number and you can specify whether we use comma or dot as decimal separator or detect it automatically from FileMaker's settings.
Thousands separator can be given.

Examples

Format numbers:

MBS("Math.FormatNumber"; 123) & ¶ &
MBS("Math.FormatNumber"; 12,34; 2; ",") & ¶ &
MBS("Math.FormatNumber"; 0,001; 3; "") & ¶ &
MBS("Math.FormatNumber"; 123456789,1235; 3; ""; ".")

Example result:
123
12,34
0.001
123,456,789.124

Try negative numbers:

MBS("Math.FormatNumber"; -123) & ¶ &
MBS("Math.FormatNumber"; -12,34; 2; ",") & ¶ &
MBS("Math.FormatNumber"; -0,001; 3; "") & ¶ &
MBS("Math.FormatNumber"; -123456789,1235; 3; ""; ".")

Example result:
-123
-12,34
-0.001
-123,456,789.124

Try huge number:

MBS("Math.FormatNumber"; 1234567890123456789012345678901234567890,1234567890; 8; ","; ".")

Example result: 1.234.567.890.123.456.789.012.345.678.901.234.567.890,12345679

Release notes

  • Version 11.1
    • Added Math.FormatNumber function.

Created 22nd January 2019, last changed 16th February 2021


Math.EncodeNumber   -   Math.HexToDec

Feedback: Report problem or ask question.




Links
MBS FileMaker blog

Start Chat