formatJapaneseEnglish関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Writes a Japanese address in English order, as a form from abroad expects: building, room, block, town, municipality, prefecture, postal code, Japan. The prefecture and municipality are always romaji, from the tables; the town and building are written as they were parsed, since the tables hold no romaji for towns.
インポート
import { formatJapaneseEnglish } from "@johnmorrisdotca/address-plus/jp";
ほかのエクスポート元: @johnmorrisdotca/address-plus
定義
function formatJapaneseEnglish(address: ParsedAddress, options?: JapaneseEnglishFormattingOptions): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
address | ParsedAddress | The address, as |
options (省略可) | JapaneseEnglishFormattingOptions | Whether to end with the postal code and with Japan (see |
戻り値
string
The address as one line, its parts joined by commas.
例
import { formatJapaneseEnglish } from "@johnmorrisdotca/address-plus/jp";
import { parseLocation } from "@johnmorrisdotca/address-plus";
const parsedAddress1=parseLocation("1-2-3 Marunouchi, Chiyoda-ku, Tokyo 100-0005");
if (!parsedAddress1) throw new Error("The example address did not parse.");
console.log(formatJapaneseEnglish(parsedAddress1));
// → "1-2-3 Marunouchi, Chiyoda-ku, Tokyo 100-0005, Japan"1-2-3 Marunouchi, Chiyoda-ku, Tokyo 100-0005, Japan出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。