GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  STRFMON (3)

NAME

strfmon - convert monetary value to string

CONTENTS

Library
Synopsis
Description
Return Values
Errors
See Also
Standards
Authors
Bugs

LIBRARY


.Lb libc

SYNOPSIS


.In monetary.h ssize_t strfmon char * restrict s size_t maxsize const char * restrict format ... ssize_t strfmon_l char * restrict s size_t maxsize locale_t loc const char * restrict format ...

DESCRIPTION

The strfmon function places characters into the array pointed to by s as controlled by the string pointed to by format. No more than maxsize bytes are placed into the array.

The strfmon_l function does the same as strfmon but takes an explicit locale rather than using the current locale.

The format string is composed of zero or more directives: ordinary characters (not %), which are copied unchanged to the output stream; and conversion specifications, each of which results in fetching zero or more subsequent arguments. Each conversion specification is introduced by the % character. After the %, the following appear in sequence:

  • Zero or more of the following flags:
    = f A '=' character followed by another character f which is used as the numeric fill character.
    ^ Do not use grouping characters, regardless of the current locale default.
    + Represent positive values by prefixing them with a positive sign, and negative values by prefixing them with a negative sign. This is the default.
    ( Enclose negative values in parentheses.
    ! Do not include a currency symbol in the output.
    - Left justify the result. Only valid when a field width is specified.
  • An optional minimum field width as a decimal number. By default, there is no minimum width.
  • A '#' sign followed by a decimal number specifying the maximum expected number of digits after the radix character.
  • A '.' character followed by a decimal number specifying the number the number of digits after the radix character.
  • One of the following conversion specifiers:
    i The
    .Vt double argument is formatted as an international monetary amount.
    n The
    .Vt double argument is formatted as a national monetary amount.
    % A '%' character is written.

RETURN VALUES

If the total number of resulting bytes including the terminating NUL byte is not more than maxsize, strfmon returns the number of bytes placed into the array pointed to by s, not including the terminating NUL byte. Otherwise, -1 is returned, the contents of the array are indeterminate, and errno is set to indicate the error.

The strfmon_l function returns the same values as strfmon.

ERRORS

The strfmon function will fail if:
[E2BIG]
  Conversion stopped due to lack of space in the buffer.
[EINVAL]
  The format string is invalid.
[ENOMEM]
  Not enough memory for temporary buffers.

SEE ALSO

localeconv(3)

STANDARDS

The strfmon function conforms to -p1003.1-2001. The strfmon_l function conforms to -p1003.1-2008.

AUTHORS


.An -nosplit The strfmon function was implemented by
.An Alexey Zelkin Aq phantom@FreeBSD.org .

This manual page was written by
.An Jeroen Ruigrok van der Werven Aq asmodai@FreeBSD.org based on the standards’ text.

BUGS

The strfmon function does not correctly handle multibyte characters in the format argument.
Search for    or go to Top of page |  Section 3 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.