Encoding and decoding Suzhou numerals in TypeScript.
Deno
import * as suzhouNumerals from "https://deno.land/x/[email protected]/mod.ts";
Browser
<script type="module">
import * as suzhouNumerals from 'https://cdn.jsdelivr.net/gh/weakish/[email protected]/mod.js'
</script>
// same as fromNumber(123, 10)
suzhouNumerals.fromNumber(123)) // "〡二〣"
// same as toNumber("〡二〣", 10)
suzhouNumerals.toNumber("〡二〣")) // 123
suzhouNumerals.encode("123")) // "〡二〣"
suzhouNumerals.decode("〡二〣")) // "123"
0BSD