jp-numeral

2019-05-21

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

Loading by quicklisp

Quicklisp

(ql:quickload "jp-numeral")

or, Loading manually

Libraries depending on

  • asdf
  • babel
  • alexandria
  • 1am (only by test codes.)

Loading

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

For running tests, do below additionally.

(asdf:load-asd "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)
"????????????????????"

?????????

Puts as a rate with old glyphs.

CL-USER> (format nil "~@/jp-numeral:wari/" 0.123)
"??????"

????????

Puts as a yen with old glyphs.

CL-USER> (format nil "~@/jp-numeral:yen/" 12000.67)
"?????????"

??????????? / Puts with positional notation.

: ???? @ ?????????

Use both : and @ modifier.

CL-USER> (format nil "~@:/jp-numeral:jp/" 12345687890)
"???????????"

API

Please see docstrings of these functions in jp-numeral package:

  • format-jp-numeral
  • jp
  • wari
  • yen
Author
YOKOTA Yuki <y2q.actionman@gmail.com>
License
MIT