Formatter for numbers and monetary values. More...
Inherits BFormat.
Public Member Functions | |
~BNumberFormat () | |
Destructor. | |
status_t | Format (BString &string, const double value) |
Format the double value as a string and put the result into string in the current locale. | |
status_t | Format (BString &string, const int32 value) |
Format the int32 value as a string and put the result into string in the current locale. | |
ssize_t | Format (char *string, size_t maxSize, const double value) |
Format the double value as a string and put the result into string up to maxSize bytes in the current locale. | |
ssize_t | Format (char *string, size_t maxSize, const int32 value) |
Format the int32 value as a string and put the result into string up to maxSize bytes in the current locale. | |
status_t | FormatMonetary (BString &string, const double value) |
Format the double value as a monetary string and put the result into string in the current locale. | |
ssize_t | FormatMonetary (char *string, size_t maxSize, const double value) |
Format the double value as a monetary string and put the result into string up to maxSize bytes in the current locale. | |
Formatter for numbers and monetary values.
BNumberFormat::~BNumberFormat | ( | ) |
Destructor.
Format the double
value as a string and put the result into string in the current locale.
string | The string to put the formatted number into. |
value | The number that you want to get a formatted version of. |
B_OK | Everything went fine. |
B_ERROR | Unable to lock the BNumberFormat. |
B_NO_MEMORY | Ran out of memory while creating the NumberFormat object. |
B_BAD_VALUE | There was not enough space to store the result. |
Format the int32
value as a string and put the result into string in the current locale.
string | The string to put the formatted number into. |
value | The number that you want to get a formatted version of. |
B_OK | Everything went fine. |
B_ERROR | Unable to lock the BNumberFormat. |
B_NO_MEMORY | Ran out of memory while creating the NumberFormat object. |
B_BAD_VALUE | There was not enough space to store the result. |
ssize_t BNumberFormat::Format | ( | char * | string, |
size_t | maxSize, | ||
const double | value | ||
) |
Format the double
value as a string and put the result into string up to maxSize bytes in the current locale.
string | The string to put the formatted number into. |
maxSize | The maximum of bytes to copy into string. |
value | The number that you want to get a formatted version of. |
B_ERROR | Unable to lock the BNumberFormat. |
B_NO_MEMORY | Ran out of memory while creating the NumberFormat object. |
B_BAD_VALUE | There was not enough space to store the result. |
ssize_t BNumberFormat::Format | ( | char * | string, |
size_t | maxSize, | ||
const int32 | value | ||
) |
Format the int32
value as a string and put the result into string up to maxSize bytes in the current locale.
string | The string to put the formatted number into. |
maxSize | The maximum of bytes to copy into string. |
value | The number that you want to get a formatted version of. |
B_ERROR | Unable to lock the BNumberFormat. |
B_NO_MEMORY | Ran out of memory while creating the NumberFormat object. |
B_BAD_VALUE | There was not enough space to store the result. |
Format the double
value as a monetary string and put the result into string in the current locale.
string | The string to put the monetary formatted number into. |
value | The number to format as a monetary value. |
B_OK | Everything went fine. |
B_ERROR | Unable to lock the BNumberFormat. |
B_NO_MEMORY | Ran out of memory while creating the NumberFormat object. |
B_BAD_VALUE | There was not enough space to store the result. |
ssize_t BNumberFormat::FormatMonetary | ( | char * | string, |
size_t | maxSize, | ||
const double | value | ||
) |
Format the double
value as a monetary string and put the result into string up to maxSize bytes in the current locale.
It uses the money symbol set by the Locale (€, $, ...) or the generic money symbol (¤) if the locale is not country-specific.
string | The string to put the monetary formatted number into. |
maxSize | The maximum of bytes to copy into string. |
value | The number to format as a monetary value. |
B_ERROR | Unable to lock the BNumberFormat. |
B_NO_MEMORY | Ran out of memory while creating the NumberFormat object. |
B_BAD_VALUE | There was not enough space to store the result. |