Skip to content

Instantly share code, notes, and snippets.

@ivand58
Created April 5, 2018 12:01
Show Gist options
  • Save ivand58/bf7ccce49ea1cfe1e564559076084d5d to your computer and use it in GitHub Desktop.
Save ivand58/bf7ccce49ea1cfe1e564559076084d5d to your computer and use it in GitHub Desktop.
print fixed point, two digs after dec point
\ print fixed point, two digs after dec point
: f.2 ( df -- )
0,005 d+ \ rounding
0 <# #s 2drop \ whole part
[char] . hold< \ decimal separator
f# f# \ frac part
0 #> \ finish
type space \ print
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment