The jp-numeral Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The jp-numeral Reference Manual

This is the jp-numeral Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 04:05:42 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Abstract

Common Lisp で漢数字を出すというネタパッケージ。cl:format との統合も可能。

This is a fun package for printing numbers as Japanese numerals. This can be integrated with cl:format.

License

The MIT License. See LICENSE file.

Loading

Libraries depending on

Loading

(load "jp-numeral.asd")
(asdf:load-system :jp-numeral)

For running tests, do below additionally.

(load "jp-numeral-test.asd")
(asdf:test-system :jp-numeral)

Examples

通常の漢数字を出力する / Puts as (normal) Japanese numerals.

CL-USER> (format nil "~/jp-numeral:jp/" 12345687890)
"百二十三億四千五百六十八万七千八百九十"

CL-USER> (format nil "~/jp-numeral:jp/" 123/4567)
"四千五百六十七分の百二十三"

CL-USER> (format nil "~/jp-numeral:jp/" -0.0245)
"マイナス二厘四毛五糸"

割合や円として出力 / Puts as rate or yen.

割合として。

Puts as a rate (using ).

CL-USER> (format nil "~/jp-numeral:wari/" 0.123)
"一割二分三厘"

円として。

Puts as yen ().

CL-USER> (format nil "~/jp-numeral:yen/" 12000.67)
"一万二千円六十七銭"

大字を使用する / Puts as formal numbers.

: 修飾子を使用する。

Use : modifier.

CL-USER> (format nil "~:/jp-numeral:jp/" 12345687890)
"壱百弐拾参億四千五百六拾八万七千八百九拾"

大字で割合として。

Puts as a formal rate.

CL-USER> (format nil "~:/jp-numeral:wari/" 0.123)
"壱割弐分参厘"

大字で円として。

Puts as a formal yen.

CL-USER> (format nil "~:/jp-numeral:yen/" 12000.67)
"壱万弐千円六拾七銭"

旧字体を使用する / Puts with old glyphs.

@ 修飾子を使用する。

Use @ modifier.

CL-USER> (format nil "~@/jp-numeral:jp/" 12345687890)
"壹佰貳拾參億肆仟伍佰陸拾捌萬柒仟捌佰玖拾"

Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 jp-numeral

Author

YOKOTA Yuki <y2q.actionman@gmail.com>

License

MIT

Description

A printer for Japanese numerals.

Dependencies
Source

jp-numeral.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

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


Previous: , Up: Modules   [Contents][Index]

3.1 jp-numeral/src

Parent

jp-numeral (system)

Location

src/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

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


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 jp-numeral.asd

Location

jp-numeral.asd

Systems

jp-numeral (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 jp-numeral/src/package.lisp

Parent

src (module)

Location

src/package.lisp

Packages

jp-numeral


Next: , Previous: , Up: Lisp files   [Contents][Index]

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

Dependency

package.lisp (file)

Parent

src (module)

Location

src/jp-numeral-table.lisp

Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

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

Dependency

jp-numeral-table.lisp (file)

Parent

src (module)

Location

src/jp-numeral.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 jp-numeral

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Functions

Function: format-jp-numeral STREAM OBJECT STYLE &key DIGITS-AFTER-DOT SCALE RADIX-POINT
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: jp STREAM OBJECT &optional COLON-P AT-SIGN-P DIGITS-AFTER-DOT SCALE RADIX-POINT
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: wari STREAM OBJECT &optional COLON-P AT-SIGN-P DIGITS-AFTER-DOT &aux STYLE
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: yen STREAM OBJECT &optional COLON-P AT-SIGN-P DIGITS-AFTER-DOT &aux STYLE
Package

jp-numeral

Source

jp-numeral.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Constants

Constant: +digits+

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

Package

jp-numeral

Source

jp-numeral-table.lisp (file)

Constant: +fraction-parts-of+

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

Package

jp-numeral

Source

jp-numeral-table.lisp (file)

Constant: +minus-sign+

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

Package

jp-numeral

Source

jp-numeral-table.lisp (file)

Constant: +power-alist+

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

Package

jp-numeral

Source

jp-numeral-table.lisp (file)

Constant: +power-max+
Package

jp-numeral

Source

jp-numeral-table.lisp (file)

Constant: +power-min+
Package

jp-numeral

Source

jp-numeral-table.lisp (file)

Constant: +radix-point+

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

Package

jp-numeral

Source

jp-numeral-table.lisp (file)

Constant: +sen+

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

Package

jp-numeral

Source

jp-numeral-table.lisp (file)

Constant: +table-formal-index+
Package

jp-numeral

Source

jp-numeral-table.lisp (file)

Constant: +table-normal-index+
Package

jp-numeral

Source

jp-numeral-table.lisp (file)

Constant: +table-old-index+
Package

jp-numeral

Source

jp-numeral-table.lisp (file)

Constant: +table-positional-index+
Package

jp-numeral

Source

jp-numeral-table.lisp (file)

Constant: +wari+

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

Package

jp-numeral

Source

jp-numeral-table.lisp (file)

Constant: +yen+

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

Package

jp-numeral

Source

jp-numeral-table.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.2 Functions

Function: flag-to-style COLON-P AT-SIGN-P
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: float-sufficient-width FLT
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: get-digit N STYLE
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: get-minus-sign STYLE
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: get-parts-of STYLE
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: get-power N STYLE
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: get-radix-point STYLE
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: get-sen STYLE
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: get-wari STYLE
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: get-yen STYLE
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: make-digits4-string DIGITS4 STYLE BASE-POWER
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: print-jp-plus-integer STREAM OBJECT STYLE
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: stringify-float FLT DIGITS-AFTER-DOT SCALE
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: style-to-index STYLE
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: translate-digit-char C STYLE
Package

jp-numeral

Source

jp-numeral.lisp (file)

Function: write-positional-from-string STREAM LISPSTR STYLE RADIX-POINT-STRING
Package

jp-numeral

Source

jp-numeral.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

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 (file)

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 STREAM (OBJECT rational) STYLE &rest ARGS &key SCALE &allow-other-keys around
Method: write-jp-numeral STREAM OBJECT STYLE &key &allow-other-keys

Previous: , Up: Internal definitions   [Contents][Index]

6.2.4 Conditions

Condition: no-power-char-error ()
Package

jp-numeral

Source

jp-numeral.lisp (file)

Direct superclasses

error (condition)

Condition: not-formattable-error ()
Package

jp-numeral

Source

jp-numeral.lisp (file)

Direct superclasses

error (condition)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   J   L   M  
Index Entry  Section

F
File, Lisp, jp-numeral.asd: The jp-numeral<dot>asd file
File, Lisp, jp-numeral/src/jp-numeral-table.lisp: The jp-numeral/src/jp-numeral-table<dot>lisp file
File, Lisp, jp-numeral/src/jp-numeral.lisp: The jp-numeral/src/jp-numeral<dot>lisp file
File, Lisp, jp-numeral/src/package.lisp: The jp-numeral/src/package<dot>lisp file

J
jp-numeral.asd: The jp-numeral<dot>asd file
jp-numeral/src: The jp-numeral/src module
jp-numeral/src/jp-numeral-table.lisp: The jp-numeral/src/jp-numeral-table<dot>lisp file
jp-numeral/src/jp-numeral.lisp: The jp-numeral/src/jp-numeral<dot>lisp file
jp-numeral/src/package.lisp: The jp-numeral/src/package<dot>lisp file

L
Lisp File, jp-numeral.asd: The jp-numeral<dot>asd file
Lisp File, jp-numeral/src/jp-numeral-table.lisp: The jp-numeral/src/jp-numeral-table<dot>lisp file
Lisp File, jp-numeral/src/jp-numeral.lisp: The jp-numeral/src/jp-numeral<dot>lisp file
Lisp File, jp-numeral/src/package.lisp: The jp-numeral/src/package<dot>lisp file

M
Module, jp-numeral/src: The jp-numeral/src module

Jump to:   F   J   L   M  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

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

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

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

J
jp: Exported functions

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

P
print-jp-plus-integer: Internal functions

S
stringify-float: Internal functions
style-to-index: Internal functions

T
translate-digit-char: Internal functions

W
wari: Exported functions
write-jp-numeral: Internal generic functions
write-jp-numeral: Internal generic functions
write-jp-numeral: Internal generic functions
write-jp-numeral: Internal generic functions
write-jp-numeral: Internal generic functions
write-jp-numeral: Internal generic functions
write-jp-numeral: Internal generic functions
write-jp-numeral: Internal generic functions
write-jp-numeral: Internal generic functions
write-positional-from-string: Internal functions

Y
yen: Exported functions

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

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   +  
C  
Index Entry  Section

+
+digits+: Internal constants
+fraction-parts-of+: Internal constants
+minus-sign+: Internal constants
+power-alist+: Internal constants
+power-max+: Internal constants
+power-min+: Internal constants
+radix-point+: Internal constants
+sen+: Internal constants
+table-formal-index+: Internal constants
+table-normal-index+: Internal constants
+table-old-index+: Internal constants
+table-positional-index+: Internal constants
+wari+: Internal constants
+yen+: Internal constants

C
Constant, +digits+: Internal constants
Constant, +fraction-parts-of+: Internal constants
Constant, +minus-sign+: Internal constants
Constant, +power-alist+: Internal constants
Constant, +power-max+: Internal constants
Constant, +power-min+: Internal constants
Constant, +radix-point+: Internal constants
Constant, +sen+: Internal constants
Constant, +table-formal-index+: Internal constants
Constant, +table-normal-index+: Internal constants
Constant, +table-old-index+: Internal constants
Constant, +table-positional-index+: Internal constants
Constant, +wari+: Internal constants
Constant, +yen+: Internal constants

Jump to:   +  
C  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   J   N   P   S  
Index Entry  Section

C
Condition, no-power-char-error: Internal conditions
Condition, not-formattable-error: Internal conditions

J
jp-numeral: The jp-numeral system
jp-numeral: The jp-numeral package

N
no-power-char-error: Internal conditions
not-formattable-error: Internal conditions

P
Package, jp-numeral: The jp-numeral package

S
System, jp-numeral: The jp-numeral system

Jump to:   C   J   N   P   S