Skip to content

weakish/suzhou-numerals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

suzhou-numerals

codecov

Encoding and decoding Suzhou numerals in TypeScript.

Import

Deno

import * as suzhouNumerals from "https://deno.land/x/suzhou_numerals@0.1.0/mod.ts";

Browser

<script type="module">
import * as suzhouNumerals from 'https://cdn.jsdelivr.net/gh/weakish/suzhou-numerals@0.1.0/mod.js'
</script>

API

// same as fromNumber(123, 10)
suzhouNumerals.fromNumber(123)) // "〡二〣"
// same as toNumber("〡二〣", 10)
suzhouNumerals.toNumber("〡二〣")) // 123

suzhouNumerals.encode("123")) // "〡二〣"
suzhouNumerals.decode("〡二〣")) // "123"

License

0BSD