fixed$

A function that can be used in Formulas.

## Syntax and semantics

`fixed$` (`number`, `precision`)
  format a number as a string, with `precision` digits after the decimal point.
`fixed$` (`vector#`, `precision`)
  format a vector as a string, with all elements expressed in `precision` digits after the decimal point.
`fixed$` (`matrix##`, `precision`)
  format a matrix as a string, with all cells expressed in `precision` digits after the decimal point.

## Examples

`assert fixed$ (pi, 3) = "3.142"
` `assert fixed$ (-1, 3) = "-1.000"
` `assert fixed$ (1e6, 3) = "1000000.000"
` `assert fixed$ (0.01, 3) = "0.010"
` `assert fixed$ (0.001, 3) = "0.001"
` `assert fixed$ (0.0001, 3) = "0.0001" ; never less than 1 significant digit!
` `
` `assert fixed$ ({ pi, -1, 1e6, 0.0001 }, 3) =
` `... "3.142" + newline$ + "-1.000" + newline$ +
` `... "1000000.000" + newline$ + "0.0001" + newline$
`

### Links to this page

- `clock`
- energy integration continuity test
- Functions
- Scripting 5.1. Variables
- What was new in 4.0?
- What's new?