npm-bahtrext

BahtRext

Download/month Total Download

Quality Gate Status Bugs Code Smells Duplicated Lines (%) Lines of Code

Reliability Rating Security Rating Maintainability Rating Vulnerabilities

Install

ES6

npm install bahtrext@2.5.0

ES5

npm install bahtrext@1.7.2

Demo / Example

Must Read

Beliefs

  1. Money in Thai Baht can be translate to word
  2. Default Decimal places is 2 digits; 3+ digits are optional.
  3. Support Negative Number as Other Baht JS Library
  4. All Synchronous function
  5. This Number System not working well with large numbers. Is there a better way to read numbers in Thai?

Test Regex

😊 Plz Consider

Author

Chadin Chaipornpisuth

Changes

Flow

flowchart TD
    A(ABT) -->|input type| B{Type}
    B --> |Number| C(iTHBText)
    B --> |String| D{Allow Negative ?}
    D --> |True| E(NEG)
    D --> |False| F(BF)
    E --> F(BF)
    F --> G(BT)
    G --> |Convert Number to Decimal| H(BahtText)
    H --> I(MoneyLaundering)
    I --> J(splitIntFrac)
    J --> |moneyFull| K[/moneyFull/]
    J --> |moneyInt| L[/moneyInt/]
    J --> |moneyFrac| M[/moneyFrac/]
    K --> |moneyFull| N{Match Zero ?}
    N --> |True| P[/Zero/]
    P --> ZZZ(return)
    M --> |moneyFrac| O(PrintSatangs)
    O --> |satang_part| R
    L --> |moneyInt| Q(PrintBaht)
    Q --> |baht_part| R(Concat)
    R --> ZZZ