Non-decimal radices/Convert: Difference between revisions
→{{header|Haskell}}: + Devanagari and HinduArabic digits
(→{{header|Haskell}}: (change order of functions to match order of description in preamble)) |
(→{{header|Haskell}}: + Devanagari and HinduArabic digits) |
||
Line 1,297:
inOctal :: Int -> String
inOctal = inBaseDigits "01234567"
inDevanagariDecimal :: Int -> String
inDevanagariDecimal = inBaseDigits "०१२३४५६७८९"
inHinduArabicDecimal :: Int -> String
inHinduArabicDecimal = inBaseDigits "٠١٢٣٤٥٦٧٨٩"
toBase :: Int -> Int -> String
Line 1,307 ⟶ 1,313:
main =
mapM_ putStrLn $
[ inLowerHex
, inUpperHex
, inBinary
, inOctal
, toBase 16
, toBase 2
, inDevanagariDecimal
, inHinduArabicDecimal
] <*>
[254]</lang>
{{Out}}
Line 1,315 ⟶ 1,330:
376
fe
11111110
२५४
٢٥٤</pre>
=={{header|HicEst}}==
|