6 #ifndef _EDITABLE_LARGE_NUMBER_MENU_ITEM_H_
7 #define _EDITABLE_LARGE_NUMBER_MENU_ITEM_H_
10 #include <IoLogging.h>
18 #define LARGE_NUM_MAX_DIGITS 12
19 #define LARGE_NUM_ALLOC_SIZE (LARGE_NUM_MAX_DIGITS / 2)
29 uint8_t bcdRepresentation[LARGE_NUM_ALLOC_SIZE] = {};
30 bool negative =
false;
31 uint8_t totalSize = 12;
32 uint8_t fractionDp = 0;
76 totalSize = maxDigits;
86 void setValue(uint32_t whole, uint32_t fraction,
bool negative);
166 return bcdRepresentation;
185 bool negativeAllowed;
190 negativeAllowed = allowNeg;
196 negativeAllowed = allowNeg;
202 negativeAllowed =
true;
208 negativeAllowed = allowNeg;
217 bool isNegativeAllowed()
const {
return negativeAllowed; }
Definition: EditableLargeNumberMenuItem.h:27
int decimalPointIndex() const
Definition: EditableLargeNumberMenuItem.h:60
uint32_t fromBcdPacked(int start, int end)
Definition: EditableLargeNumberMenuItem.cpp:22
void setFromFloat(float value)
Definition: EditableLargeNumberMenuItem.cpp:76
uint32_t getFraction()
Definition: EditableLargeNumberMenuItem.h:157
void setValue(uint32_t whole, uint32_t fraction, bool negative)
Definition: EditableLargeNumberMenuItem.cpp:15
void setDigit(int digit, int val)
Definition: EditableLargeNumberMenuItem.cpp:52
uint8_t * getNumberBuffer()
Definition: EditableLargeNumberMenuItem.h:165
float getAsFloat()
Definition: EditableLargeNumberMenuItem.cpp:66
void setNegative(bool neg)
Definition: EditableLargeNumberMenuItem.h:143
void clear()
Definition: EditableLargeNumberMenuItem.cpp:10
int getTotalDigits() const
Definition: EditableLargeNumberMenuItem.h:65
int getDigit(int digit)
Definition: EditableLargeNumberMenuItem.cpp:41
uint32_t getWhole()
Definition: EditableLargeNumberMenuItem.h:150
bool isNegative() const
Definition: EditableLargeNumberMenuItem.h:137
LargeFixedNumber()=default
void convertToBcdPacked(uint32_t value, int start, int end)
Definition: EditableLargeNumberMenuItem.cpp:32
void setPrecision(uint8_t dp, uint8_t maxDigits=12)
Definition: EditableLargeNumberMenuItem.h:74