Number names: Difference between revisions

Content deleted Content added
m →‎[[Number names#ALGOL 68]]: add an alternative version in a python style...
m →‎[[Number names#ALGOL 68]]: tidy for iterator loop
Line 258: Line 258:
ELSE
ELSE
STRING out := "", sep:="";
STRING out := "", sep:="";
# FOR x IN # base1000 rev(n, # DO #
# FOR e, x IN # base1000 rev(n, # DO #
(INT e, LINT x)VOID:
(INT e, LINT x)VOID:
IF x NE 0 THEN
IF x NE 0 THEN
big(e,x) + sep +=: out;
big(e,x) + sep +=: out;
sep := IF e = 0 AND x < 100 THEN " and " ELSE ", " FI
sep := IF e = 0 AND x < 100 THEN " and " ELSE ", " FI
FI
FI
);
)
# OD; #
# OD #;
out
out
FI
FI
Line 289: Line 289:
2010: two thousand and ten
2010: two thousand and ten
</pre>
</pre>

=={{header|BASIC}}==
=={{header|BASIC}}==
{{works with|QBasic}}
{{works with|QBasic}}