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.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Formats a number.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Math | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
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 |
Returns OK or error.
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
Format currency:
MBS("Math.FormatNumber"; $amount; 2; ","; ".") & " €"
Created 22nd January 2019, last changed 11st March 2021
Math.EncodeNumber - Math.HexToDec
Feedback: Report problem or ask question.