The library number-to-chinese-words can be used in 2 ways:
Repo: https://github.com/siakhooi/ts-number-to-chinese-words/
$ npm i @siakhooi/number-to-chinese-wordsThen in javascript file:
const NumberToChineseWords = require('@siakhooi/number-to-chinese-words'); console.log(NumberToChineseWords.convertNumber(7));
<script src="https://siakhooi.github.io/ts-number-to-chinese-words/number-to-chinese-words.bundle.js"></script>
<script src="https://unpkg.com/@siakhooi/number-to-chinese-words/dist/number-to-chinese-words.bundle.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@siakhooi/number-to-chinese-words/dist/number-to-chinese-words.bundle.js"></script>
<HTML>
<HEAD>
<script src="https://siakhooi.github.io/ts-number-to-chinese-words/number-to-chinese-words.bundle.js"></script>
</HEAD>
<BODY>
<div id="demo"></div>
<script>
document.getElementById('demo').innerHTML = '1777=' + convertNumber(1777);
</script>
</BODY>
</HTML>