site/node_modules/speech-rule-engine/js/l10n/numbers/numbers_nemeth.js

16 lines
473 B
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const messages_1 = require("../messages");
function numberToWords(num) {
const digits = num.toString().split('');
return digits
.map(function (digit) {
return NUMBERS.ones[parseInt(digit, 10)];
})
.join('');
}
const NUMBERS = (0, messages_1.NUMBERS)();
NUMBERS.numberToWords = numberToWords;
NUMBERS.numberToOrdinal = numberToWords;
exports.default = NUMBERS;