-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
097be45
commit 40a33e0
Showing
152 changed files
with
611 additions
and
552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import ABT from "./index.mjs"; | ||
console.log(ABT("1234567890")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {BT} from "./index.mjs" | ||
import THBText from "thai-baht-text" | ||
import { bahttext } from "bahttext"; | ||
import { convert } from "numbaht"; | ||
|
||
// Comment out FAIL Test Cases | ||
|
||
test("THBText", () => { | ||
expect(BT("999999999999999")).toBe(THBText(999999999999999)); | ||
expect(BT((2 ** 53).toString())).toBe(THBText(2 ** 53)); | ||
expect(BT((2 ** 55).toString())).toBe(THBText(2 ** 55)); | ||
expect(BT((2 ** 60).toString())).toBe(THBText(2 ** 60)); | ||
expect(BT((2 ** 69).toString())).toBe(THBText(2 ** 69)); | ||
}); | ||
|
||
test("jojoee/bahttext", () => { | ||
expect(bahttext(999999999999999)).toBe(BT("999999999999999")); | ||
expect(bahttext(12.33)).toBe(BT("12.33")); | ||
// expect(bahttext(999999999999999.99)).toBe(BT("999999999999999.99")); | ||
// expect(bahttext('999999999999999.99')).toBe(BT("999999999999999.99")); | ||
}); | ||
|
||
test(`numbaht`, () => { | ||
expect( | ||
convert("หนึ่งร้อยหนึ่ง") | ||
).toBe(`101`); | ||
expect(convert("หนึ่งร้อยเอ็ด")).toBe(`101`); | ||
// expect(convert("สิบห้าร้อยสตางค์")).toBe(undefined); | ||
// expect(convert("สิบห้าร้อย")).toBe(undefined); | ||
// expect(convert("สิบห้าบาทสองสิบสตางค์")).toBe(undefined); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const THB = new Intl.NumberFormat("th-TH", { | ||
style: "currency", | ||
currency: "THB", | ||
}); | ||
export default THB; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import SPECIALTWO from "../primitive/SPECIALTWO.mjs"; | ||
import THREE from "../primitive/THREE.mjs"; | ||
import FOUR from "../primitive/FOUR.mjs"; | ||
import FIVE from "../primitive/FIVE.mjs"; | ||
import SIX from "../primitive/SIX.mjs"; | ||
import SEVEN from "../primitive/SEVEN.mjs"; | ||
import EIGHT from "../primitive/EIGHT.mjs"; | ||
import NINE from "../primitive/NINE.mjs"; | ||
const FTHAISATANGWORDS = [ | ||
``, | ||
``, | ||
SPECIALTWO, | ||
THREE, | ||
FOUR, | ||
FIVE, | ||
SIX, | ||
SEVEN, | ||
EIGHT, | ||
NINE, | ||
]; | ||
export default FTHAISATANGWORDS; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import SPECIALONE from "../primitive/SPECIALONE.mjs"; | ||
import TWO from "../primitive/TWO.mjs"; | ||
import THREE from "../primitive/THREE.mjs"; | ||
import FOUR from "../primitive/FOUR.mjs"; | ||
import FIVE from "../primitive/FIVE.mjs"; | ||
import SIX from "../primitive/SIX.mjs"; | ||
import SEVEN from "../primitive/SEVEN.mjs"; | ||
import EIGHT from "../primitive/EIGHT.mjs"; | ||
import NINE from "../primitive/NINE.mjs"; | ||
|
||
const LTHAISATANGWORDS = [ | ||
``, | ||
SPECIALONE, | ||
TWO, | ||
THREE, | ||
FOUR, | ||
FIVE, | ||
SIX, | ||
SEVEN, | ||
EIGHT, | ||
NINE, | ||
]; | ||
export default LTHAISATANGWORDS; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import ONE from "../primitive/ONE.mjs"; | ||
import TWO from "../primitive/TWO.mjs"; | ||
import THREE from "../primitive/THREE.mjs"; | ||
import FOUR from "../primitive/FOUR.mjs"; | ||
import FIVE from "../primitive/FIVE.mjs"; | ||
import SIX from "../primitive/SIX.mjs"; | ||
import SEVEN from "../primitive/SEVEN.mjs"; | ||
import EIGHT from "../primitive/EIGHT.mjs"; | ||
import NINE from "../primitive/NINE.mjs"; | ||
const ONETONINE = [ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE]; | ||
export default ONETONINE; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import TEN from "../primitive/TEN.mjs"; | ||
import HUNDRED from "../primitive/HUNDRED.mjs"; | ||
import THOUSAND from "../primitive/THOUSAND.mjs"; | ||
import TENTHOUSAND from "../primitive/TENTHOUSAND.mjs"; | ||
import HUNDREDTHOUSAND from "../primitive/HUNDREDTHOUSAND.mjs"; | ||
|
||
const REVERSETHAIDIGITWORDS = [ | ||
HUNDREDTHOUSAND, | ||
TENTHOUSAND, | ||
THOUSAND, | ||
HUNDRED, | ||
TEN, | ||
"", | ||
]; | ||
export default REVERSETHAIDIGITWORDS; |
Oops, something went wrong.