Skip to content

Commit 44f43b7

Browse files
committed
improve number parsing
1 parent 8c575c6 commit 44f43b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dictionary/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ const prepositionDefinition = checkedSimpleUnitWithTemplate(
294294
.map((preposition) => ({ type: "preposition", preposition }) as const);
295295
const numeralDefinition = checkedSimpleUnit("num")
296296
.mapWithPositionedError((num) => {
297-
const numeral = Number.parseInt(num, 10);
298-
if (Number.isNaN(numeral)) {
297+
const numeral = +num;
298+
if (!Number.isInteger(numeral)) {
299299
throw `"${num}" is not a number`;
300300
} else {
301301
return { type: "numeral", numeral } as const;

0 commit comments

Comments
 (0)