Formatter for numbers and monetary values.
More...
Inherits BFormat.
Inherited by BFloatFormat, and BIntegerFormat.
|
| BNumberFormat (const BNumberFormat &other) |
| Copy Constructor. More...
|
|
| ~BNumberFormat () |
| Destructor. More...
|
|
ssize_t | Format (char *string, size_t maxSize, const double value) const |
| Format the double value as a string and put the result into string up to maxSize bytes in the current locale. More...
|
|
status_t | Format (BString &string, const double value) const |
| Format the double value as a string and put the result into string in the current locale. More...
|
|
ssize_t | Format (char *string, size_t maxSize, const int32 value) const |
| Format the int32 value as a string and put the result into string up to maxSize bytes in the current locale. More...
|
|
status_t | Format (BString &string, const int32 value) const |
| Format the int32 value as a string and put the result into string in the current locale. More...
|
|
ssize_t | FormatMonetary (char *string, size_t maxSize, const double value) const |
| Format the double value as a monetary string and put the result into string up to maxSize bytes in the current locale. More...
|
|
status_t | FormatMonetary (BString &string, const double value) const |
| Format the double value as a monetary string and put the result into string in the current locale. More...
|
|
Formatter for numbers and monetary values.
- Since
- Haiku R1
Copy Constructor.
- Parameters
-
- Since
- Haiku R1
BNumberFormat::~BNumberFormat |
( |
| ) |
|
Destructor.
- Since
- Haiku R1
ssize_t BNumberFormat::Format |
( |
char * |
string, |
|
|
size_t |
maxSize, |
|
|
const double |
value |
|
) |
| const |
Format the double
value as a string and put the result into string up to maxSize bytes in the current locale.
- Parameters
-
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. |
- Returns
- The length of the string created or an error status code.
- Return values
-
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. |
- See also
- BNumberFormat::Format(char* string, size_t maxSize, int32 value) const
-
ssize_t BNumberFormat::FormatMonetary(char* string, size_t maxSize, double value) const
- Since
- Haiku R1
status_t BNumberFormat::Format |
( |
BString & |
string, |
|
|
const double |
value |
|
) |
| const |
Format the double
value as a string and put the result into string in the current locale.
- Parameters
-
string | The string to put the formatted number into. |
value | The number that you want to get a formatted version of. |
- Returns
- A status code.
- Return values
-
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. |
- See also
- BNumberFormat::Format(BString* string, int32 value) const
-
BNumberFormat::FormatMonetary(BString* string, double value) const
- Since
- Haiku R1
ssize_t BNumberFormat::Format |
( |
char * |
string, |
|
|
size_t |
maxSize, |
|
|
const int32 |
value |
|
) |
| const |
Format the int32
value as a string and put the result into string up to maxSize bytes in the current locale.
- Parameters
-
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. |
- Returns
- The length of the string created or an error status code.
- Return values
-
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. |
- See also
- BNumberFormat::Format(char* string, size_t maxSize, double value) const
-
BNumberFormat::FormatMonetary(char* string, size_t maxSize, double value) const
- Since
- Haiku R1
status_t BNumberFormat::Format |
( |
BString & |
string, |
|
|
const int32 |
value |
|
) |
| const |
Format the int32
value as a string and put the result into string in the current locale.
- Parameters
-
string | The string to put the formatted number into. |
value | The number that you want to get a formatted version of. |
- Returns
- A status code.
- Return values
-
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. |
- See also
- BNumberFormat::Format(BString* string, double value) const
-
BNumberFormat::FormatMonetary(BString* string, double value) const
- Since
- Haiku R1
ssize_t BNumberFormat::FormatMonetary |
( |
char * |
string, |
|
|
size_t |
maxSize, |
|
|
const double |
value |
|
) |
| const |
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.
- Parameters
-
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. |
- Returns
- The length of the string created or an error status code.
- Return values
-
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. |
- See also
- BNumberFormat::Format(char* string, size_t maxSize, double value) const
-
BNumberFormat::Format(char* string, size_t maxSize, int32 value) const
- Since
- Haiku R1
status_t BNumberFormat::FormatMonetary |
( |
BString & |
string, |
|
|
const double |
value |
|
) |
| const |
Format the double
value as a monetary string and put the result into string in the current locale.
- Parameters
-
string | The string to put the monetary formatted number into. |
value | The number to format as a monetary value. |
- Returns
- A status code.
- Return values
-
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. |
- See also
- BNumberFormat::Format(BString* string, double value) const
-
BNumberFormat::Format(BString* string, int32 value) const
- Since
- Haiku R1