Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

String

fixed_str


fixed_str

Formats a number as text with exactly places decimal places (for example, fixed_str(-0.56789, 2) returns “-0.57”). Guarantees a clean display regardless of floating-point representation, making it ideal for showing noisy values such as joystick axes. Use FIXED for the rounded number form.

fixed_str(value, places)

Parameters

  • value - Any numeric expression
  • places - Number of decimal places (0-15; negative values are treated as 0)

Example

SCREEN 320, 240
PRINT fixed_str(-0.56789, 2), fixed_str(2, 2)
PRINT "Score: " + fixed_str(1234.5, 1)