FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
Unrevised from 9.0 to 10.0.
9.0 version

locale-format-monetary

Arguments: stream value use-int-symbol suppress-dp &optional (locale *locale*)

Arguments:

This function outputs value to stream as a monetary amount appropriate to the specified locale.

If use-int-symbol is true, then the locale's international currency symbol (locale-int-curr-symbol) is used, otherwise the locale's currency-symbol (locale-currency-symbol) value is used.

If suppress-dp is true, then the decimal-point is not displayed if the locale's appropriate monetary fractional digits specification is zero. Note: It is an error for value to be a non-integer when being displayed with a locale where the fractional digits specification is zero.

The function locale-format-monetary can be invoked using the format ~/ directive. The locale argument can be supplied using format's ~v construct. The use-int-symbol argument is specified using the colon modifier. The suppress-dp argument is specified using the at-sign modifer.

Examples:

;; [assuming *locale* is (find-locale "en_US")]

(locale-format-monetary *terminal-io* 1045.67 nil nil)  
  prints `$1,045.67'

(locale-format-monetary *terminal-io* 1045.67 t nil)
  prints `USD 1,045.67'

(locale-format-monetary *terminal-io* 1045.67 t nil :fr_FR)
  prints `FRF 1 045,6700'

(format t "~v/locale-format-monetary/" :en_US 1045.67)
  prints `$1,045.67'

(format t "~v/locale-format-monetary/" :fr_FR 1045.67)
  prints `F1 045,6700'

(format t "~v:/locale-format-monetary/" :fr_FR 1045.67)
  prints `FRF 1 045,6700'

(format t "~v:/locale-format-monetary/" :ja_JP 1045)
  prints `JPY 1,045.'

(format t "~v@:/locale-format-monetary/" :ja_JP 1045)
  prints `JPY 1,045'

See Localization support in Allegro CL in iacl.htm.


Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 9.0 page.
Created 2015.5.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
Unrevised from 9.0 to 10.0.
9.0 version