1 // © 2017 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 #include "unicode/utypes.h"
6 #if !UCONFIG_NO_FORMATTING
7 #ifndef __NUMBER_SCIENTIFIC_H__
8 #define __NUMBER_SCIENTIFIC_H__
10 #include "number_types.h"
12 U_NAMESPACE_BEGIN
namespace number
{
16 class ScientificHandler
;
18 class U_I18N_API ScientificModifier
: public UMemory
, public Modifier
{
22 void set(int32_t exponent
, const ScientificHandler
*handler
);
24 int32_t apply(NumberStringBuilder
&output
, int32_t leftIndex
, int32_t rightIndex
,
25 UErrorCode
&status
) const U_OVERRIDE
;
27 int32_t getPrefixLength(UErrorCode
&status
) const U_OVERRIDE
;
29 int32_t getCodePointCount(UErrorCode
&status
) const U_OVERRIDE
;
31 bool isStrong() const U_OVERRIDE
;
35 const ScientificHandler
*fHandler
;
38 class ScientificHandler
: public UMemory
, public MicroPropsGenerator
, public MultiplierProducer
{
40 ScientificHandler(const Notation
*notation
, const DecimalFormatSymbols
*symbols
,
41 const MicroPropsGenerator
*parent
);
44 processQuantity(DecimalQuantity
&quantity
, MicroProps
µs
, UErrorCode
&status
) const U_OVERRIDE
;
46 int32_t getMultiplier(int32_t magnitude
) const U_OVERRIDE
;
49 const Notation::ScientificSettings
& fSettings
;
50 const DecimalFormatSymbols
*fSymbols
;
51 const MicroPropsGenerator
*fParent
;
53 friend class ScientificModifier
;
60 #endif //__NUMBER_SCIENTIFIC_H__
62 #endif /* #if !UCONFIG_NO_FORMATTING */