Anonymous user
Price fraction: Difference between revisions
m
→{{header|REXX}}: added DO-END and SELECT labels. -- ~~~~
Catskill549 (talk | contribs) m (→{{header|AWK}}) |
m (→{{header|REXX}}: added DO-END and SELECT labels. -- ~~~~) |
||
Line 1,842:
=={{header|REXX}}==
<lang rexx>/*REXX program to rescale a price (0.99 --> 1.00). */▼
do j=0 to 1 by .01▼
▲/*REXX program to rescale a price (0.99 --> 1.00). */
say 'original price-->'j " " adjustPrice(j) '<-- adjusted price'▼
▲ do j=0 to 1 by .01
▲ say 'original price-->'j " " adjustPrice(j) '<-- adjusted price'
exit
/*------------------------------------------------------------------*/
adjustPrice: procedure; parse arg x
select▼
when x<0.06 then x=0.10
▲ select
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<0.
when x<
otherwise nop▼
▲ when x<1.01 then x=1.00
end /*select*/
▲ otherwise nop
return x</lang>▼
'''output'''
▲return x
<pre style="height:30ex;overflow:scroll">
original price-->0.00 0.10 <-- adjusted price
|