Options
All
  • Public
  • Public/Protected
  • All
Menu

阿拉伯数字和中文数字互转

example
const arabicChinese = new ArabicChinese();

// 数字转中文
arabicChinese.encode('1');

// >> '一'

// 中文转数字
arabicChinese.decode('一');

// >> 1

// 数字转金额
arabicChinese.decode('1');

// >> 人民币一元整

Hierarchy

  • ArabicChinese

Index

Constructors

Methods

Constructors

constructor

Methods

decode

  • decode(zhNum: string, options?: IOptions): number

encode

  • encode(num: string | number, options?: IOptions): string
  • 数字转中文

    Parameters

    • num: string | number
    • Optional options: IOptions

    Returns string

toMoney

  • toMoney(num: string | number, options?: IOptions): string
  • 数字转金额

    Parameters

    • num: string | number
    • Optional options: IOptions

    Returns string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc