The jp-numeral Reference Manual

This is the jp-numeral Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 16:48:37 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 jp-numeral

A printer for Japanese numerals.

Author

YOKOTA Yuki <>

License

MIT

Dependencies
  • alexandria (system).
  • babel (system).
Source

jp-numeral.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 jp-numeral/src

Source

jp-numeral.asd.

Parent Component

jp-numeral (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 jp-numeral/jp-numeral.asd

Source

jp-numeral.asd.

Parent Component

jp-numeral (system).

ASDF Systems

jp-numeral.


4.1.2 jp-numeral/src/package.lisp

Source

jp-numeral.asd.

Parent Component

src (module).

Packages

jp-numeral.


4.1.3 jp-numeral/src/jp-numeral-table.lisp

Dependency

package.lisp (file).

Source

jp-numeral.asd.

Parent Component

src (module).

Internals

4.1.4 jp-numeral/src/jp-numeral.lisp

Dependency

jp-numeral-table.lisp (file).

Source

jp-numeral.asd.

Parent Component

src (module).

Public Interface
Internals

5 Packages

Packages are listed by definition order.


5.1 jp-numeral

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Ordinary functions

Function: format-jp-numeral (stream object style &key digits-after-dot scale radix-point)

This function works same as ‘jp’, but arranges the arguments for convenience of calling from ordinary functions.
This writes OBJECT into STREAM as Japanese numerals with the style specified by STYLE.

Arguments are same as ‘jp’, except below:

- STYLE

Specify the style of output. Pass one of these symbols:

- ‘:normal’ :: Use normal Japanese numerals.
- ‘:formal’ :: Use formal styles.
- ‘:old’ :: Use old glyphs.
- ‘:positional’ :: Use positional notations.

====

‘jp’ と同じことを行うが、普通の関数として呼び出すのに便利なように
引数を置きかえている。
STYLE で指定した形式で、 STREAM に OBJECT を書き出す。

以下の引数以外は、‘jp’ の引数と同様。

- STYLE

出力形式を指定する。以下のいずれかのシンボルを渡す。

- ‘:normal’ :: 一般的な漢数字を使用する。
- ‘:formal’ :: 大字を使用する。
- ‘:old’ :: 旧字体を使用する。
- ‘:positional’ :: 位取り記数法を使用する。

Package

jp-numeral.

Source

jp-numeral.lisp.

Function: jp (stream object &optional colon-p at-sign-p digits-after-dot scale radix-point)

This function writes OBJECT into STREAM as Japanese numerals.
This can be called from ‘cl:format’ with ’~/’ directive.

Arguments are:

- STREAM

Output destination stream.

- OBJECT

The object to be outputted.

- COLON-P, AT-SIGN-P

COLON-P and AT-SIGN-P specify the style for printing.
The corresponding is below:

- (and (not colon-p) (not at-sign-p)) :: Use normal Japanese numerals. - (and colon-p (not at-sign-p)) :: Use formal styles.
- (and (not colon-p) at-sign-p) :: Use Old glyphs.
- (and colon-p at-sign-p) :: Use positional Notation.

- DIGITS-AFTER-DOT

Specifies how many digits putted after the radix point when printing a floating-point number.
When ‘nil’ is specified, uses an appropriate one.

- SCALE

When printing, uses a number mutiplied with (expt 10 scale).

- RADIX-POINT

Specifies a character or a string used as a radix point.

====

STREAM に OBJECT を漢数字として書き出す。
‘cl:format’ の ‘~/‘ での関数呼びだしでも使用できる。

引数:

- STREAM

出力先の stream

- OBJECT

出力する object

- COLON-P, AT-SIGN-P

二つの組み合わせで出力形式を指定する。対応は以下の通り:

- (and (not colon-p) (not at-sign-p)) :: 通常の漢数字
- (and colon-p (not at-sign-p)) :: 大字
- (and (not colon-p) at-sign-p) :: 旧字体
- (and colon-p at-sign-p) :: 位取り記数法

- DIGITS-AFTER-DOT

浮動小数点数を出力する時に、小数点の後に何桁目まで出力するか。
‘nil’ にすると、適当に十分な数で出す。

- SCALE

出力の時に、 (expt 10 scale) を掛けた値を出力する。

- RADIX-POINT

小数点に使用する、文字もしくは文字列。

Package

jp-numeral.

Source

jp-numeral.lisp.

Function: wari (stream object &optional colon-p at-sign-p digits-after-dot)

This function works like ‘jp’, but puts as a rate.
The output value is multiplied with 10, and ’割’ is used for the radix point.

Arguments are same as ‘jp’.

====

‘jp’ と同様だが、 割合として表示する。
10倍され、小数点に ’割’ を使用した値が表示される。

引数は ‘jp’ と同様。

Package

jp-numeral.

Source

jp-numeral.lisp.

Function: yen (stream object &optional colon-p at-sign-p digits-after-dot)

This function works like ‘jp’, but puts as a yen.
The output value is rounded on specified position, and printed until ‘1’ with ’円’, until ‘0.01’ with ’銭’, and until ‘0.001’ with ’厘’.

Arguments are same as ‘jp’, except below:

- DIGITS-AFTER-DOT

Specifies how many digits putted after a radix point. The default is 2. Only one of ‘0‘, ‘2‘, or ‘3‘ is available.

====

‘jp’ と同様だが、 円として表示する。
指定した桁で丸め、 ‘1’ の桁までは ’円’ で、 ‘0.01’ の桁までは ’銭’ で、 ‘0.001’ の桁は ’厘’ で表示する。

以下の引数以外は、‘jp’ の引数と同様。

- DIGITS-AFTER-DOT

小数点以下のどの桁まで表示するか指定する。デフォルトは 2。
‘0‘ , ‘2‘ , ‘3‘ のいずれかが使用できる。

Package

jp-numeral.

Source

jp-numeral.lisp.


6.2 Internals


6.2.1 Constants

Constant: +digits+

A vector of (<normal> <formal> <old> <positional>)

Package

jp-numeral.

Source

jp-numeral-table.lisp.

Constant: +fraction-parts-of+

A vector of (<normal> <formal> <old> <positional>

Package

jp-numeral.

Source

jp-numeral-table.lisp.

Constant: +minus-sign+

A vector of (<normal> <formal> <old> <positional>

Package

jp-numeral.

Source

jp-numeral-table.lisp.

Constant: +power-hash-table+

An alist of (<power> . (<normal> <formal> <old> <positional>))

Package

jp-numeral.

Source

jp-numeral-table.lisp.

Constant: +radix-point+

A vector of (<normal> <formal> <old> <positional>

Package

jp-numeral.

Source

jp-numeral-table.lisp.

Constant: +sen+

A vector of (<normal> <formal> <old> <positional>

Package

jp-numeral.

Source

jp-numeral-table.lisp.

Constant: +table-formal-index+
Package

jp-numeral.

Source

jp-numeral-table.lisp.

Constant: +table-normal-index+
Package

jp-numeral.

Source

jp-numeral-table.lisp.

Constant: +table-old-index+
Package

jp-numeral.

Source

jp-numeral-table.lisp.

Constant: +table-positional-index+
Package

jp-numeral.

Source

jp-numeral-table.lisp.

Constant: +wari+

A vector of (<normal> <formal> <old> <positional>

Package

jp-numeral.

Source

jp-numeral-table.lisp.

Constant: +yen+

A vector of (<normal> <formal> <old> <positional>

Package

jp-numeral.

Source

jp-numeral-table.lisp.


6.2.2 Ordinary functions

Function: flag-to-style (colon-p at-sign-p)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: float-sufficient-width (flt)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: get-digit (n style)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: get-minus-sign (style)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: get-parts-of (style)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: get-power (n style)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: get-radix-point (style)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: get-sen (style)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: get-wari (style)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: get-yen (style)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: make-digits4-string (digits4 style base-power)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: print-jp-plus-integer (stream object style)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: stringify-float (flt digits-after-dot scale)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: style-to-index (style)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: translate-digit-char (c style)
Package

jp-numeral.

Source

jp-numeral.lisp.

Function: write-positional-from-string (stream lispstr style radix-point-string)
Package

jp-numeral.

Source

jp-numeral.lisp.


6.2.3 Generic functions

Generic Function: write-jp-numeral (stream object style &key digits-after-dot scale radix-point-string radix-point-required-p &allow-other-keys)
Package

jp-numeral.

Source

jp-numeral.lisp.

Methods
Method: write-jp-numeral (stream (object float) style &key digits-after-dot scale radix-point-string radix-point-required-p)
Method: write-jp-numeral (stream (object ratio) style &key digits-after-dot scale radix-point-string radix-point-required-p)
Method: write-jp-numeral (stream (object integer) style &key digits-after-dot scale radix-point-string radix-point-required-p)
Method: write-jp-numeral (stream (object float) (style (eql :positional)) &key digits-after-dot scale radix-point-string radix-point-required-p)
Method: write-jp-numeral (stream (object ratio) (style (eql :positional)) &key digits-after-dot scale radix-point-string radix-point-required-p)
Method: write-jp-numeral (stream (object integer) (style (eql :positional)) &key digits-after-dot scale radix-point-string radix-point-required-p)
Method: write-jp-numeral :around (stream (object rational) style &rest args &key scale &allow-other-keys)
Method: write-jp-numeral (stream object style &key &allow-other-keys)

6.2.4 Conditions

Condition: no-power-char-error
Package

jp-numeral.

Source

jp-numeral.lisp.

Direct superclasses

error.

Condition: not-formattable-error
Package

jp-numeral.

Source

jp-numeral.lisp.

Direct superclasses

error.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   F   G   J   M   P   S   T   W   Y  
Index Entry  Section

F
flag-to-style: Private ordinary functions
float-sufficient-width: Private ordinary functions
format-jp-numeral: Public ordinary functions
Function, flag-to-style: Private ordinary functions
Function, float-sufficient-width: Private ordinary functions
Function, format-jp-numeral: Public ordinary functions
Function, get-digit: Private ordinary functions
Function, get-minus-sign: Private ordinary functions
Function, get-parts-of: Private ordinary functions
Function, get-power: Private ordinary functions
Function, get-radix-point: Private ordinary functions
Function, get-sen: Private ordinary functions
Function, get-wari: Private ordinary functions
Function, get-yen: Private ordinary functions
Function, jp: Public ordinary functions
Function, make-digits4-string: Private ordinary functions
Function, print-jp-plus-integer: Private ordinary functions
Function, stringify-float: Private ordinary functions
Function, style-to-index: Private ordinary functions
Function, translate-digit-char: Private ordinary functions
Function, wari: Public ordinary functions
Function, write-positional-from-string: Private ordinary functions
Function, yen: Public ordinary functions

G
Generic Function, write-jp-numeral: Private generic functions
get-digit: Private ordinary functions
get-minus-sign: Private ordinary functions
get-parts-of: Private ordinary functions
get-power: Private ordinary functions
get-radix-point: Private ordinary functions
get-sen: Private ordinary functions
get-wari: Private ordinary functions
get-yen: Private ordinary functions

J
jp: Public ordinary functions

M
make-digits4-string: Private ordinary functions
Method, write-jp-numeral: Private generic functions
Method, write-jp-numeral: Private generic functions
Method, write-jp-numeral: Private generic functions
Method, write-jp-numeral: Private generic functions
Method, write-jp-numeral: Private generic functions
Method, write-jp-numeral: Private generic functions
Method, write-jp-numeral: Private generic functions
Method, write-jp-numeral: Private generic functions

P
print-jp-plus-integer: Private ordinary functions

S
stringify-float: Private ordinary functions
style-to-index: Private ordinary functions

T
translate-digit-char: Private ordinary functions

W
wari: Public ordinary functions
write-jp-numeral: Private generic functions
write-jp-numeral: Private generic functions
write-jp-numeral: Private generic functions
write-jp-numeral: Private generic functions
write-jp-numeral: Private generic functions
write-jp-numeral: Private generic functions
write-jp-numeral: Private generic functions
write-jp-numeral: Private generic functions
write-jp-numeral: Private generic functions
write-positional-from-string: Private ordinary functions

Y
yen: Public ordinary functions