StrF()

Syntax

Result$ = StrF(Value.f [, NbDecimal])
Description
Convert a float number into a string. A maximum number of decimal places can be specified. The number will be rounded, if 'NbDecimal' is smaller than existing decimal places of 'Value.f'.

Note: Signed integer numbers must be converted with Str() or StrQ() and unsigned numbers with StrU().

Example:
  value.f = 10.54
  result$ = "Result: " + StrF(value)    ; we don't use the 2nd parameter, so we get a full float number
  Debug result$
  result$ = "Result: " + StrF(value,2)  ; we want a result with two decimal places, no rounding needed as we have only two
  Debug result$
  result$ = "Result: " + StrF(value,0)  ; we want a result with no decimal places, so the value is rounded
  Debug result$

Supported OS

All

<- StrD() - String Index - StrQ() ->