Price fraction: Difference between revisions
Content added Content deleted
Catskill549 (talk | contribs) m (→{{header|AWK}}) |
m (→{{header|REXX}}: added DO-END and SELECT labels. -- ~~~~) |
||
Line 1,842: | Line 1,842: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
⚫ | |||
<lang rexx> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
end /*j*/ |
|||
⚫ | |||
end |
|||
exit |
exit |
||
/*------------------------------------------------------------------*/ |
|||
adjustPrice: procedure; parse arg x |
adjustPrice: procedure; parse arg x |
||
⚫ | |||
when x<0.06 then x=0.10 |
|||
⚫ | |||
when x<0. |
when x<0.11 then x=0.18 |
||
when x<0. |
when x<0.16 then x=0.26 |
||
when x<0. |
when x<0.21 then x=0.32 |
||
when x<0. |
when x<0.26 then x=0.38 |
||
when x<0. |
when x<0.31 then x=0.44 |
||
when x<0. |
when x<0.36 then x=0.50 |
||
when x<0. |
when x<0.41 then x=0.54 |
||
when x<0. |
when x<0.46 then x=0.58 |
||
when x<0. |
when x<0.51 then x=0.62 |
||
when x<0. |
when x<0.56 then x=0.66 |
||
when x<0. |
when x<0.61 then x=0.70 |
||
when x<0. |
when x<0.66 then x=0.74 |
||
when x<0. |
when x<0.71 then x=0.78 |
||
when x<0. |
when x<0.76 then x=0.82 |
||
when x<0. |
when x<0.81 then x=0.86 |
||
when x<0. |
when x<0.86 then x=0.90 |
||
when x<0. |
when x<0.91 then x=0.94 |
||
when x<0. |
when x<0.96 then x=0.98 |
||
when x< |
when x<1.01 then x=1.00 |
||
⚫ | |||
⚫ | |||
end /*select*/ |
|||
⚫ | |||
⚫ | |||
end |
|||
'''output''' |
|||
⚫ | |||
</lang> |
|||
Output: |
|||
<pre style="height:30ex;overflow:scroll"> |
<pre style="height:30ex;overflow:scroll"> |
||
original price-->0.00 0.10 <-- adjusted price |
original price-->0.00 0.10 <-- adjusted price |