Jump to content

Formatted numeric output: Difference between revisions

Line 1,231:
{let { {:a :a} {:b :b} {:n {abs :n}} {:sign {if {>= :n 0} then + else -}}
{:trunc {trunc :n}}
{:dec {abs {truncceil {* 1.0e:b {abs {- :n {trunc :n}}}}} }
} {br}{padd {- :a {W.length {trunc :n}}} >}
{if {W.equal? :sign -} then else :sign}:trunc.:dec{padd {- :b {W.length :dec}} 0} }}}
-> fmt
Line 1,253:
>>>>>> -1000.000
>>>>>>> +559.799
>>>>>>>> -69.989990
>>>>>> +4970.430
</lang>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.