Socket
Socket
Sign inDemoInstall

myanmar-num-to-word

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    myanmar-num-to-word

Myanmar-Num-to-Word is simple Javascript module to convert Myanmar numbers **digits to words** plus **burmese numbers to english numbers** conversion.


Version published
Weekly downloads
79
increased by25.4%
Maintainers
1
Install size
29.8 kB
Created
Weekly downloads
 

Readme

Source

Myanmar-Num-to-Word

Myanmar-Num-to-Word is simple Javascript module to convert Myanmar numbers digits to words plus burmese numbers to english numbers conversion.

Available to test on Demo.

Examples

Numbers to Words

1 => တစ်
12 => တစ်ဆယ့်နှစ်
123 => တစ်ရာ နှစ်ဆယ့်သုံး
1234 => တစ်ထောင် နှစ်ရာ သုံးဆယ့်လေး
12345 => တစ်သောင်း နှစ်ထောင် သုံးရာ လေးဆယ့်ငါး
123456 => တစ်သိန်း နှင့် နှစ်သောင်း သုံးထောင် လေးရာ ငါးဆယ့်ခြောက်
1234567 => တစ်ဆယ့်နှစ်သိန်း နှင့် သုံးသောင်း လေးထောင် ငါးရာ ခြောက်ဆယ့်ခုနှစ်
12345678 => သိန်းတစ်ရာ နှစ်ဆယ့်သုံးသိန်း နှင့် လေးသောင်း ငါးထောင် ခြောက်ရာ ခုနှစ်ဆယ့်ရှစ်
123456789 => သိန်းတစ်ထောင် နှစ်ရာ သုံးဆယ့်လေးသိန်း နှင့် ငါးသောင်း ခြောက်ထောင် ခုနှစ်ရာ ရှစ်ဆယ့်ကိုး
1234567890 => သိန်းတစ်သောင်း နှစ်ထောင် သုံးရာ လေးဆယ့်ငါးသိန်း နှင့် ခြောက်သောင်း ခုနှစ်ထောင် ရှစ်ရာ ကိုးဆယ်

Burmese to English and Vice Versa

0123456789 => ၀၁၂၃၄၅၆၇၈၉
၀၁၂၃၄၅၆၇၈၉ => 0123456789

Features

  • Digits to Words
  • Burmese Numbers <=> English Numbers conversion

For Digits to Words conversion, the library provides 2 modes - Written and Speech. In Speech mode, pronunciation rule shifts numerical place name (the tens, hundreds and thousands place) from the low tone to the creaky tone.

Written Mode (Default) => တစ်ထောင် နှစ်ရာ သုံးဆယ့်လေး
Speech Mode => တစ်ထောင့် နှစ်ရာ့ သုံးဆယ့်လေး

Digits to Words can accept both burmese and english numbers input.

Installation

Install using npm:
npm install myanmar-num-to-word --save  
In the browser

You can simply include the CDN link, kindly provided by unpkg.

<script src="https://unpkg.com/myanmar-num-to-word@latest"></script>  

Usages

In browser

<script src="myanmarNumToWord.js"></script> 
<script>    
  console.log(myanmarNumToWord.convertToBurmeseWords(12345)); // တစ်သောင်း နှစ်ထောင် သုံးရာ လေးဆယ့်ငါး
  console.log(myanmarNumToWord.convertToBurmeseWords(12345, 'speech')); // တစ်သောင်း နှစ်ထောင့် သုံးရာ့ လေးဆယ့်ငါး
  console.log(myanmarNumToWord.convertToEnglishNumber('၁၂၃၄၅')); // 12345
  console.log(myanmarNumToWord.convertToBurmeseNumber(12345)); // ၁၂၃၄၅  
</script>  

In Node

const myanmarNumToWord = require('myanmar-num-to-word');  
myanmarNumToWord.convertToBurmeseWords(12345); // တစ်သောင်း နှစ်ထောင် သုံးရာ လေးဆယ့်ငါး  
myanmarNumToWord.convertToBurmeseWords(12345, 'speech'); // တစ်သောင်း နှစ်ထောင့် သုံးရာ့ လေးဆယ့်ငါး
myanmarNumToWord.convertToEnglishNumber('၁၂၃၄၅'); // 12345  
myanmarNumToWord.convertToBurmeseNumber(12345); // ၁၂၃၄၅  

Credit for Numerical Knowledge

License MIT

Keywords

FAQs

Last updated on 22 Jan 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc