Anonymous user
Formatted numeric output: Difference between revisions
→{{header|Lambdatalk}}
Line 1,231:
{let { {:a :a} {:b :b} {:n {abs :n}} {:sign {if {>= :n 0} then + else -}}
{:trunc {trunc :n}}
{:dec {
} {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.
>>>>>> +4970.430
</lang>
|