Skip to the content

Hikidashi引き出し

Era dates (和暦) and kanji numerals both ways, the dictionary forms of a conjugated word, a reading shared out over its kanji, words pulled from pasted text, and how hard a sentence is to read.

Hikidashi (引き出し) is a drawer: each tool is pulled out when it is wanted. About the name

Contents

Reference · Kanji numerals

readJapaneseNumberfunction

The number said aloud, in hiragana, with the sound changes a learner has to know: 300 is さんびゃく, 600 ろっぴゃく, 800 はっぴゃく, 3,000 さんぜん, 8,000 はっせん, and 一兆 いっちょう. Zero is ゼロ.

Import it

import { readJapaneseNumber } from "@johnmorrisdotca/hikidashi/numerals";

Also exported from: @johnmorrisdotca/hikidashi

Definition

function readJapaneseNumber(value: number): string | null

Parameters

NameTypeDescription
valuenumber

A whole number from 0 to 9,007,199,254,740,991.

Returns

string | null

The reading in hiragana; null when the number is out of range: negative, not a whole number, or past 9,007,199,254,740,991.

Examples

import { readJapaneseNumber } from "@johnmorrisdotca/hikidashi/numerals";

console.log(readJapaneseNumber(300), readJapaneseNumber(600), readJapaneseNumber(800), readJapaneseNumber(3000));
console.log(readJapaneseNumber(25_000), readJapaneseNumber(0), readJapaneseNumber(-3));
さんびゃく ろっぴゃく はっぴゃく さんぜん
にまんごせん ゼロ null

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hikidashi 1.1.0.