format-number(value, pattern)
Formats value with format defined by pattern. Result is a string:
| Number | Format | string |
|---|---|---|
| 0.0123456789 | ##0 | 0 |
| -1.234 | ##0 | -1 |
| 12345678 | ##0 | 12345678 |
| -1.234 | 000 | -001 |
| 0.00004 | 000.000 | 000.000 |
| 0.12345678 | 000.000 | 000.012 |
| 12345678 | 000.000 | 12345678.000 |
| 0.00004 | ##0.0## | 0.0 |
| 123 | ##0.0## | 123.0 |
| 12345678 | ##0.0## | 12345678.0 |
| 12345678 | ###,###,##0.0## | 12,345,678.0 |
Look up the standard or read a book if you need anything more complex!