npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

myanmar-notation

v1.5.3

Published

A Node.js module and a library which converts the given number into words in Myanmar.

Downloads

68

Readme

myanmar-notation

A Node.js module and a library which converts the given number into words in Myanmar. Following written rule and add the creaky tone on number places 10^5, 10^6 and 10^7. Check live Demo is available...

workflows-badge travis-badge npm-badge webpack-badge test-mocha

Normally "ပေါင်း" in Myanmar translated "plus", however the same word using in a large number of amount dedicate multiply. For example သိန်းတစ်သောင်း is 1 0000 00000 and can also/usually pronounced သိန်းပေါင်း တစ်သောင်း which mean "(100000*10000)", therefor "သိန်းတစ်သောင်း" and "သိန်းပေါင်း တစ်သောင်း" has dedicated the same amount. This module is using "ပေါင်း" when the dedicated amount is larger than the subsequent scale name "ခု", "ဆယ်", "ရာ", "ထောင်", "သောင်း", "သိန်း", "သန်း" and "ကု​ဋေ​".

It can be a bit confusing between "သိန်းတစ်သိန်း" and "တစ်သိန်း" as of spoken usually does

"ငွေ သိန်းတစ်သိန်းလောက် ချေးပေးလို့ရမလား ခင်ဗျာ"

they probabbly just wanted "100000", but it is entirely different as "သိန်းတစ်သိန်း" mean "10000 000000" and "တစ်သိန်း" mean "100000".

There are also difference positioning scale name, primarly it is followed by the given number

10: "တစ်ဆယ်" 20: "နှစ်ဆယ်" 10000000: "တစ်ကု​ဋေ​"

However using this primarly structure in large amount seem very weird, eg.100000000: "တစ်ထောင်သိန်း", "တစ်ရာသန်း", "တစ်ဆယ်ကု​ဋေ​", therefore in such amount the scale name lead the number to take away this weirdness.

100000000: "သိန်းတစ်ထောင်", "သန်းတစ်ရာ", "ကု​ဋေ​တစ်ဆယ်"

Feature

  • [x] Decimals are rounded (floor)
  • [x] Query get(2700), get('၂၇၀၀'), get('27,000,000.00') ,get('5.23e+8') is flexible
  • [x] Demo
  • [x] mocha
  • [x] webpack

Usage

Node.JS

Oops: myanmar-notation export ES module from CommonJS built version.

export * from "./index.js";

import * as e from "./index.js";
export default e;

npm i myanmar-notation can be require or import from your Node.JS application. However myanmar-notation is assuming that one day npm might force us to seperate ES module and CommonJS. Therefore, it is a good practice to start coding Node.JS application using ES module.

// ES6
import myanmarNotation from 'myanmar-notation';
import {get} from 'myanmar-notation';

myanmarNotation.get(2700);
// myanmarNotation.multiplication(5);
// myanmarNotation.keep(123);
// myanmarNotation.turn('၄၅၆');
get(12345678);

// CommonJS
const myanmarNotation = require('myanmar-notation');
const {get} = require('myanmar-notation');

myanmarNotation.get(2700);
get(12345678);

Browser

Include the file myanmar-notation@latest/min.js in your web application. It is available on UNPKG and jsDelivr.

Now let's assume that you have picked the jsDelivr one...

<script src="https://cdn.jsdelivr.net/npm/ttfmeta@latest/min.js"></script>
<script>
let notation = window.myanmarNotation;
</script>

API

You may assure that the APIs are not going to change without a good reason for end user. So any exported methods and classes name will stays the same as the last updates.

Multiplication

the notation.multiplication() construct the given len to zero ending, it takes 2 arguments (len, head='1'), second argument is optional and return the result as string.

notation.multiplication(5,'10');
> "100000"

Keep

the notation.keep() convert the given string(number) to Burmese number and return the result as string.

notation.keep(1234567);
> "၁၂၃၄၅၆၇"

notation.keep('a567');
> "a၅၆၇"

Turn

the notation.turn() convert the given string(number) to English number and return the result as string.

notation.turn('၁၂၃၄၅၆၇');
> "1234567"

notation.turn('123၅၆၇');
> "123567"

get

the notation.get() return an object if there is a sense in get query, otherwise empty Object return.

notation.get(2700);
// return
>  {
    "number": "၂၇၀၀",
    "digit": "2700",
    "notation": [
      {
        "sense": "နှစ်ထောင့်ခုနစ်ရာ"
      }
    ]
  }

notation.get(12345678);
// return
>  {
    "number": "၁၂၃၄၅၆၇၈",
    "digit": "12345678",
    "notation": [
      {
        "sense": "သိန်းတစ်ရာ့နှစ်ဆယ့်သုံး လေးသောင်းငါးထောင့်ခြောက်ရာ့ခုနစ်ဆယ့်ရှစ်",
        "rule": 5,
        "size": 8,
        "list": [
          "123",
          "45678"
        ]
      },
      {
        "sense": "သန်းတစ်ဆယ့်နှစ် သုံးသိန်းလေးသောင်းငါးထောင့်ခြောက်ရာ့ခုနစ်ဆယ့်ရှစ်",
        "rule": 6,
        "size": 8,
        "list": [
          "12",
          "345678"
        ]
      },
      {
        "sense": "တစ်ကု​ဋေ​ နှစ်သန်းသုံးသိန်းလေးသောင်းငါးထောင့်ခြောက်ရာ့ခုနစ်ဆယ့်ရှစ်",
        "rule": 7,
        "size": 8,
        "list": [
          "1",
          "2345678"
        ]
      }
    ]
  }

License

shield-license