Non-decimal radices/Convert: Difference between revisions

Added Easylang
m (→‎{{header|Wren}}: Minor tidy)
(Added Easylang)
Line 1,350:
? integerToString(200, 16)
# value: "c8"</syntaxhighlight>
 
=={{header|EasyLang}}==
<syntaxhighlight>
func$ n2s n b .
if n = 0
return "0"
.
d = n mod b
if d > 9
d += 39
.
d$ = strchar (d + 48)
if n < b
return d$
.
return n2s (n div b) b & d$
.
func s2n s$ b .
r = 0
for c$ in strchars s$
d = strcode c$ - 48
if d > 9
d -= 39
.
r = r * b + d
.
return r
.
print n2s 253 16
print s2n "fd" 16
print n2s 0 16
</syntaxhighlight>
 
=={{header|Elixir}}==
2,063

edits