diff --git a/deno.json b/deno.json index d6ed9b1..79d8ccf 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@hckhanh/vn-number", - "version": "1.1.1", + "version": "1.1.2", "exports": "./src/index.ts", "exclude": [ ".github/", diff --git a/src/read/index.test.ts b/src/read/index.test.ts index 4150560..783338b 100644 --- a/src/read/index.test.ts +++ b/src/read/index.test.ts @@ -9,4 +9,8 @@ describe('index', function () { it('should read number 2.000.000.000 in number', function () { expect(readVnNumber(2000000000)).to.equal('hai tỷ') }) + + it('should read number 2.500.000.000 in BigIn', function () { + expect(readVnNumber(BigInt(2500000000))).to.equal('hai tỷ năm trăm triệu') + }) }) diff --git a/src/read/index.ts b/src/read/index.ts index b244d69..f1f4a13 100644 --- a/src/read/index.ts +++ b/src/read/index.ts @@ -11,12 +11,13 @@ import NumberReader from './NumberReader.ts' * ```ts * import { readVnNumber } from '@hckhanh/vn-number' * - * readVnNumber('19990000') // or readVnNumber(19990000) // output: mười chín triệu chín trăm chín mươi nghìn + * readVnNumber('19990000') // or readVnNumber(19990000) + * // output: mười chín triệu chín trăm chín mươi nghìn * ``` * * @param number the number to read. It can be string or number type * @return the Vietnamese number in string. */ -export function readVnNumber(number: string | number): string { +export function readVnNumber(number: string | number | BigInt): string { return NumberReader.read(number) }