(* format the decimal portion of a number *) (* display normal precision *) Print(N(Pi)); (* calculate a specified precision, approx. 104,348/33,215 *) x = N( 3943771611212266962743738812600748213157266596588744951727393497446921245353005283 / 1255341492699841451528811722575401081588363886480089431843026103930863337221076748 , 152); (* convert it to a string() *) str = ToString(x); (* Symja appends string length *) str = StringTake(str, StringPosition(str, "`", 1)[[1, 1]] - 1 ); (* find the . *) dotPos = Part(StringPosition(str, "."), 1, 1); (* insert a space every thousands-th position *) For(k=StringLength(str), k >= dotPos+2, k--, If(Mod(k-dotPos, 3) == 0, str = StringInsert(str, " ", k)) ); str