Skip to content

Commit

Permalink
docs: clarify the .precision specification section for string interpo…
Browse files Browse the repository at this point in the history
…lation of floats (vlang#22061)
  • Loading branch information
mike-ward authored and medvednikov committed Aug 17, 2024
1 parent 243ca4c commit 9c4836d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,9 @@ To use a format specifier, follow this pattern:
> doesn't need `+` to right-align since that's the default.
- width: may be an integer value describing the minimum width of total field to output.
- precision: an integer value preceded by a `.` will guarantee that many digits after the decimal
point, if the input variable is a float. Ignored if variable is an integer.
point without any insignificant trailing zeros. If displaying insignificant zero's is desired,
append a `f` specifier to the precision value (see examples below). Applies only to float
variables and is ignored for integer variables.
- type: `f` and `F` specify the input is a float and should be rendered as such, `e` and `E` specify
the input is a float and should be rendered as an exponent (partially broken), `g` and `G` specify
the input is a float--the renderer will use floating point notation for small values and exponent
Expand Down

0 comments on commit 9c4836d

Please sign in to comment.