/* format the decimal portion of a number */ /* set the number of digits in bigfloat() */ fpprec : 83$ /* display a float() */ print(float(%pi))$ /* display all the digits */ fpprintprec : fpprec $ /* display a bigfloat() */ print(bfloat(%pi))$ /* calculate a bigfloat(), approx. 104,348/33,215 */ x : 3943771611212266962743738812600748213157266596588744951727393497446921245353005283b0 / 1255341492699841451528811722575401081588363886480089431843026103930863337221076748b0 $ /* print it to a string() */ str : printf(false, "~h", x)$ /* find the . */ dot_pos : sposition(".", str) - 1$ /* insert a space every thousands-th position */ for k : slength(str) step -1 thru (dot_pos + 2) do if (remainder(k-dot_pos, 3) = 0) then str : sinsert(" ", str, k+1)$ str;