1 /* 2 * Copyright 2003-2014, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _B_NUMBER_FORMAT_H_ 6 #define _B_NUMBER_FORMAT_H_ 7 8 9 #include <Format.h> 10 11 12 enum BNumberElement { 13 B_NUMBER_ELEMENT_INVALID = B_BAD_DATA, 14 B_NUMBER_ELEMENT_INTEGER = 0, 15 B_NUMBER_ELEMENT_FRACTIONAL, 16 B_NUMBER_ELEMENT_CURRENCY 17 }; 18 19 20 class BNumberFormat : public BFormat { 21 public: 22 BNumberFormat(); 23 BNumberFormat(const BNumberFormat &other); 24 ~BNumberFormat(); 25 26 // formatting 27 28 ssize_t Format(char* string, size_t maxSize, 29 const double value) const; 30 status_t Format(BString& string, const double value) 31 const; 32 ssize_t Format(char* string, size_t maxSize, 33 const int32 value) const; 34 status_t Format(BString& string, const int32 value) 35 const; 36 37 // monetary 38 39 ssize_t FormatMonetary(char* string, size_t maxSize, 40 const double value) const; 41 status_t FormatMonetary(BString& string, 42 const double value) const; 43 }; 44 45 46 #endif // _B_NUMBER_FORMAT_H_ 47