2014-10-02 11:19:54 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2003-2014, Haiku, Inc.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2009-05-01 23:23:59 +04:00
|
|
|
#ifndef _B_NUMBER_FORMAT_H_
|
|
|
|
#define _B_NUMBER_FORMAT_H_
|
|
|
|
|
2014-10-02 11:19:54 +04:00
|
|
|
|
2009-05-01 23:23:59 +04:00
|
|
|
#include <Format.h>
|
|
|
|
|
2014-10-02 11:19:54 +04:00
|
|
|
|
|
|
|
enum BNumberElement {
|
|
|
|
B_NUMBER_ELEMENT_INVALID = B_BAD_DATA,
|
|
|
|
B_NUMBER_ELEMENT_INTEGER = 0,
|
|
|
|
B_NUMBER_ELEMENT_FRACTIONAL,
|
|
|
|
B_NUMBER_ELEMENT_CURRENCY
|
|
|
|
};
|
|
|
|
|
2009-05-01 23:23:59 +04:00
|
|
|
|
2009-05-02 01:56:16 +04:00
|
|
|
class BNumberFormat : public BFormat {
|
2014-10-02 11:19:54 +04:00
|
|
|
public:
|
2014-12-05 03:13:46 +03:00
|
|
|
BNumberFormat();
|
|
|
|
BNumberFormat(const BNumberFormat &other);
|
|
|
|
~BNumberFormat();
|
2009-05-01 23:23:59 +04:00
|
|
|
|
2014-10-02 11:19:54 +04:00
|
|
|
// formatting
|
|
|
|
|
|
|
|
ssize_t Format(char* string, size_t maxSize,
|
|
|
|
const double value) const;
|
|
|
|
status_t Format(BString& string, const double value)
|
|
|
|
const;
|
|
|
|
ssize_t Format(char* string, size_t maxSize,
|
|
|
|
const int32 value) const;
|
|
|
|
status_t Format(BString& string, const int32 value)
|
|
|
|
const;
|
|
|
|
|
|
|
|
// monetary
|
|
|
|
|
|
|
|
ssize_t FormatMonetary(char* string, size_t maxSize,
|
|
|
|
const double value) const;
|
|
|
|
status_t FormatMonetary(BString& string,
|
|
|
|
const double value) const;
|
2009-05-01 23:23:59 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _B_NUMBER_FORMAT_H_
|