Commit 9746e1fe authored by Over_score's avatar Over_score

Fixed double decimal separator when entering a number

parent c7bec72e
......@@ -376,7 +376,7 @@ void addItemToNimBuffer(int16_t item) {
calcModeNim(NOPARAM);
nimBuffer[0] = '+';
nimBuffer[1] = '1';
nimBuffer[2] = radixMark == RM_PERIOD ? '.' : ',';
nimBuffer[2] = '.';
nimBuffer[3] = 0;
nimNumberPart = NP_REAL_FLOAT_PART;
lastIntegerBase = 0;
......@@ -965,7 +965,7 @@ void addItemToNimBuffer(int16_t item) {
if(done) {
//Convert nimBuffer to display string
strcpy(nimBufferDisplay, NUM_SPACE_HAIR);
strcpy(nimBufferDisplay, STD_SPACE_HAIR);
nimInputRealPartIsReal34 = false;
nimInputImaginaryPartIsReal34 = false;
......@@ -987,10 +987,10 @@ void addItemToNimBuffer(int16_t item) {
exponentToDisplayString(atoi(nimBuffer + exponentSignLocation), nimBufferDisplay + stringByteLength(nimBufferDisplay), true);
if(nimBuffer[exponentSignLocation + 1] == 0 && nimBuffer[exponentSignLocation] == '-') {
strcat(nimBufferDisplay, NUM_SUP_MINUS);
strcat(nimBufferDisplay, STD_SUP_MINUS);
}
else if(nimBuffer[exponentSignLocation + 1] == '0' && nimBuffer[exponentSignLocation] == '+') {
strcat(nimBufferDisplay, NUM_SUP_0);
strcat(nimBufferDisplay, STD_SUP_0);
}
nimInputRealPartIsReal34 = isRealDp(nimBuffer + 1);
......@@ -998,7 +998,7 @@ void addItemToNimBuffer(int16_t item) {
case NP_FRACTION_DENOMINATOR : // +123 12/7
nimBufferToDisplayBuffer(nimBuffer, nimBufferDisplay + 2);
strcat(nimBufferDisplay, NUM_SPACE_4_PER_EM);
strcat(nimBufferDisplay, STD_SPACE_4_PER_EM);
for(index=2; nimBuffer[index]!=' '; index++); // The ending semi colon is OK here
supNumberToDisplayString(atoi(nimBuffer + index + 1), nimBufferDisplay + stringByteLength(nimBufferDisplay), true);
......@@ -1033,10 +1033,10 @@ void addItemToNimBuffer(int16_t item) {
if(nimNumberPart == NP_REAL_EXPONENT) {
exponentToDisplayString(atoi(nimBuffer + exponentSignLocation), nimBufferDisplay + stringByteLength(nimBufferDisplay), true);
if(nimBuffer[exponentSignLocation + 1] == 0 && nimBuffer[exponentSignLocation] == '-') {
strcat(nimBufferDisplay, NUM_SUP_MINUS);
strcat(nimBufferDisplay, STD_SUP_MINUS);
}
else if(nimBuffer[exponentSignLocation + 1] == '0' && nimBuffer[exponentSignLocation] == '+') {
strcat(nimBufferDisplay, NUM_SUP_0);
strcat(nimBufferDisplay, STD_SUP_0);
}
}
......@@ -1044,8 +1044,8 @@ void addItemToNimBuffer(int16_t item) {
// Complex "separator"
if(complexMode == CM_RECTANGULAR) {
if(strncmp(nimBufferDisplay + stringByteLength(nimBufferDisplay) - 2, NUM_SPACE_HAIR, 2) != 0) {
strcat(nimBufferDisplay, NUM_SPACE_HAIR);
if(strncmp(nimBufferDisplay + stringByteLength(nimBufferDisplay) - 2, STD_SPACE_HAIR, 2) != 0) {
strcat(nimBufferDisplay, STD_SPACE_HAIR);
}
if(nimBuffer[imaginaryMantissaSignLocation] == '-') {
......@@ -1058,7 +1058,7 @@ void addItemToNimBuffer(int16_t item) {
strcat(nimBufferDisplay, PRODUCT_SIGN);
}
else {
strcat(nimBufferDisplay, NUM_SPACE_4_PER_EM NUM_MEASURED_ANGLE NUM_SPACE_4_PER_EM);
strcat(nimBufferDisplay, STD_SPACE_4_PER_EM STD_MEASURED_ANGLE STD_SPACE_4_PER_EM);
if(nimBuffer[imaginaryMantissaSignLocation] == '-') {
strcat(nimBufferDisplay, "-");
}
......@@ -1085,10 +1085,10 @@ void addItemToNimBuffer(int16_t item) {
if(nimNumberPart == NP_REAL_EXPONENT) {
exponentToDisplayString(atoi(nimBuffer + imaginaryExponentSignLocation), nimBufferDisplay + stringByteLength(nimBufferDisplay), true);
if(nimBuffer[imaginaryExponentSignLocation + 1] == 0 && nimBuffer[imaginaryExponentSignLocation] == '-') {
strcat(nimBufferDisplay, NUM_SUP_MINUS);
strcat(nimBufferDisplay, STD_SUP_MINUS);
}
else if(nimBuffer[imaginaryExponentSignLocation + 1] == '0' && nimBuffer[imaginaryExponentSignLocation] == '+') {
strcat(nimBufferDisplay, NUM_SUP_0);
strcat(nimBufferDisplay, STD_SUP_0);
}
}
......@@ -1116,17 +1116,15 @@ void addItemToNimBuffer(int16_t item) {
for(int i=stringByteLength(nimBufferDisplay); i>=index; i--) {
nimBufferDisplay[i + 1] = nimBufferDisplay[i];
}
//strncpy(nimBufferDisplay + index, NUM_PERIOD34, 2);
*(nimBufferDisplay + index) = *(NUM_PERIOD34);
*(nimBufferDisplay + index + 1) = *(NUM_PERIOD34 + 1);
*(nimBufferDisplay + index) = *(STD_PERIOD34);
*(nimBufferDisplay + index + 1) = *(STD_PERIOD34 + 1);
}
else if(nimBufferDisplay[index] == ',') {
for(int i=stringByteLength(nimBufferDisplay); i>=index; i--) {
nimBufferDisplay[i + 1] = nimBufferDisplay[i];
}
//strncpy(nimBufferDisplay + index, NUM_COMMA34, 2);
*(nimBufferDisplay + index) = *(NUM_COMMA34);
*(nimBufferDisplay + index + 1) = *(NUM_COMMA34 + 1);
*(nimBufferDisplay + index) = *(STD_COMMA34);
*(nimBufferDisplay + index + 1) = *(STD_COMMA34 + 1);
}
}
}
......@@ -1155,7 +1153,7 @@ static int16_t insertGapIP(char *displayBuffer, int16_t numDigits, int16_t nth)
if(nth + 1 == numDigits) return 0; // no gap after the last digit
if((numDigits - nth) % groupingGap == 1 || groupingGap == 1) {
strcpy(displayBuffer, NUM_SPACE_PUNCTUATION);
strcpy(displayBuffer, STD_SPACE_PUNCTUATION);
return 2;
}
......@@ -1168,7 +1166,7 @@ static int16_t insertGapFP(char *displayBuffer, int16_t numDigits, int16_t nth)
if(nth + 1 == numDigits) return 0; // no gap after the last digit
if(nth % groupingGap == groupingGap - 1) {
strcpy(displayBuffer, NUM_SPACE_PUNCTUATION);
strcpy(displayBuffer, STD_SPACE_PUNCTUATION);
return 2;
}
......
......@@ -181,7 +181,7 @@ void fnDisplayFormatGap(uint16_t gap) {
void exponentToDisplayString(int32_t exponent, char *displayString, bool_t nimMode) {
strcpy(displayString, PRODUCT_SIGN);
displayString += 2;
strcpy(displayString, NUM_SUB_10);
strcpy(displayString, STD_SUB_10);
displayString += 2;
displayString[0] = 0;
if(nimMode) {
......@@ -199,12 +199,12 @@ void exponentToDisplayString(int32_t exponent, char *displayString, bool_t nimMo
void supNumberToDisplayString(int32_t supNumber, char *displayString, bool_t insertGap) {
if(supNumber < 0) {
supNumber = -supNumber;
strcat(displayString, NUM_SUP_MINUS);
strcat(displayString, STD_SUP_MINUS);
displayString += 2;
}
if(supNumber == 0) {
strcat(displayString, NUM_SUP_0);
strcat(displayString, STD_SUP_0);
}
else {
int16_t digit, digitCount=0;
......@@ -218,30 +218,30 @@ void supNumberToDisplayString(int32_t supNumber, char *displayString, bool_t ins
memmove(displayString + 2, displayString, stringByteLength(displayString) + 1);
if(digit <= 1) {
*(displayString) = *(NUM_SUP_0);
*(displayString + 1) = *(NUM_SUP_0 + 1);
*(displayString) = *(STD_SUP_0);
*(displayString + 1) = *(STD_SUP_0 + 1);
displayString[1] += digit;
}
else if(digit <= 3) {
*(displayString) = *(NUM_SUP_2);
*(displayString + 1) = *(NUM_SUP_2 + 1);
*(displayString) = *(STD_SUP_2);
*(displayString + 1) = *(STD_SUP_2 + 1);
displayString[1] += digit-2;
}
else {
*(displayString) = *(NUM_SUP_4);
*(displayString + 1) = *(NUM_SUP_4 + 1);
*(displayString) = *(STD_SUP_4);
*(displayString + 1) = *(STD_SUP_4 + 1);
displayString[1] += digit-4;
}
if(greaterThan9999 && supNumber > 0 && groupingGap != 0 && ((++digitCount) % groupingGap) == 0) {
memmove(displayString + 2, displayString, stringByteLength(displayString) + 1);
*(displayString) = *(NUM_SPACE_PUNCTUATION);
*(displayString + 1) = *(NUM_SPACE_PUNCTUATION + 1);
*(displayString) = *(STD_SPACE_PUNCTUATION);
*(displayString + 1) = *(STD_SPACE_PUNCTUATION + 1);
}
}
}
strcat(displayString, NUM_SPACE_HAIR);
strcat(displayString, STD_SPACE_HAIR);
}
......@@ -249,12 +249,12 @@ void supNumberToDisplayString(int32_t supNumber, char *displayString, bool_t ins
void subNumberToDisplayString(int32_t subNumber, char *displayString) {
if(subNumber < 0) {
subNumber = -subNumber;
strcat(displayString, NUM_SUB_MINUS);
strcat(displayString, STD_SUB_MINUS);
displayString += 2;
}
if(subNumber == 0) {
strcat(displayString, NUM_SUB_0);
strcat(displayString, STD_SUB_0);
}
else {
int16_t digit;
......@@ -265,8 +265,8 @@ void subNumberToDisplayString(int32_t subNumber, char *displayString) {
memmove(displayString + 2, displayString, stringByteLength(displayString) + 1);
*(displayString) = *(NUM_SUB_0);
*(displayString + 1) = *(NUM_SUB_0 + 1);
*(displayString) = *(STD_SUB_0);
*(displayString + 1) = *(STD_SUB_0 + 1);
displayString[1] += digit;
}
}
......@@ -368,10 +368,10 @@ void realToDisplayString2(const void *real, bool_t real34, char *displayString)
if(real34IsInfinite(value)) {
if(real34IsNegative(value)) {
strcpy(displayString, "-" NUM_INFINITY);
strcpy(displayString, "-" STD_INFINITY);
}
else {
strcpy(displayString, NUM_INFINITY);
strcpy(displayString, STD_INFINITY);
}
return;
}
......@@ -392,10 +392,10 @@ void realToDisplayString2(const void *real, bool_t real34, char *displayString)
if(real16IsInfinite(value)) {
if(real16IsNegative(value)) {
strcpy(displayString, "-" NUM_INFINITY);
strcpy(displayString, "-" STD_INFINITY);
}
else {
strcpy(displayString, NUM_INFINITY);
strcpy(displayString, STD_INFINITY);
}
return;
}
......@@ -506,7 +506,7 @@ void realToDisplayString2(const void *real, bool_t real34, char *displayString)
// Zeros before first significant digit
for(digitCount=0, i=exponent+1; i<0; i++, digitCount--) {
if(digitCount != 0 && groupingGap != 0 && digitCount%(uint16_t)groupingGap == 0) {
memcpy(displayString + charIndex, NUM_SPACE_PUNCTUATION, 2);
memcpy(displayString + charIndex, STD_SPACE_PUNCTUATION, 2);
charIndex += 2;
}
displayString[charIndex++] = '0';
......@@ -515,7 +515,7 @@ void realToDisplayString2(const void *real, bool_t real34, char *displayString)
// Significant digits
for(digitPointer=firstDigit; digitPointer<firstDigit+min(displayHasNDigits - 1 - exponent, numDigits); digitPointer++, digitCount--) {
if(digitCount != 0 && groupingGap != 0 && digitCount%(uint16_t)groupingGap == 0) {
memcpy(displayString + charIndex, NUM_SPACE_PUNCTUATION, 2);
memcpy(displayString + charIndex, STD_SPACE_PUNCTUATION, 2);
charIndex += 2;
}
displayString[charIndex++] = '0' + bcd[digitPointer];
......@@ -524,7 +524,7 @@ void realToDisplayString2(const void *real, bool_t real34, char *displayString)
else { // zero or positive exponent
for(digitCount=exponent, digitPointer=firstDigit; digitPointer<=lastDigit + max(exponent - numDigits + 1, 0); digitPointer++, digitCount--) {
if(digitCount != -1 && digitCount != exponent && groupingGap != 0 && modulo(digitCount, (uint16_t)groupingGap) == (uint16_t)groupingGap - 1) {
memcpy(displayString + charIndex, NUM_SPACE_PUNCTUATION, 2);
memcpy(displayString + charIndex, STD_SPACE_PUNCTUATION, 2);
charIndex += 2;
}
......@@ -611,7 +611,7 @@ void realToDisplayString2(const void *real, bool_t real34, char *displayString)
// Zeros before first significant digit
for(digitCount=0, i=exponent+1; i<0; i++, digitCount--) {
if(digitCount!=0 && groupingGap!=0 && digitCount%(uint16_t)groupingGap==0) {
memcpy(displayString + charIndex, NUM_SPACE_PUNCTUATION, 2);
memcpy(displayString + charIndex, STD_SPACE_PUNCTUATION, 2);
charIndex += 2;
}
displayString[charIndex++] = '0';
......@@ -620,7 +620,7 @@ void realToDisplayString2(const void *real, bool_t real34, char *displayString)
// Significant digits
for(digitPointer=firstDigit; digitPointer<=lastDigit; digitPointer++, digitCount--) {
if(digitCount!=0 && groupingGap!=0 && digitCount%(uint16_t)groupingGap==0) {
memcpy(displayString + charIndex, NUM_SPACE_PUNCTUATION, 2);
memcpy(displayString + charIndex, STD_SPACE_PUNCTUATION, 2);
charIndex += 2;
}
displayString[charIndex++] = '0' + bcd[digitPointer];
......@@ -629,7 +629,7 @@ void realToDisplayString2(const void *real, bool_t real34, char *displayString)
// Zeros after last significant digit
for(i=1; i<=(int16_t)displayFormatDigits+exponent+1-numDigits; i++, digitCount--) {
if(groupingGap!=0 && digitCount%(uint16_t)groupingGap==0) {
memcpy(displayString + charIndex, NUM_SPACE_PUNCTUATION, 2);
memcpy(displayString + charIndex, STD_SPACE_PUNCTUATION, 2);
charIndex += 2;
}
displayString[charIndex++] = '0';
......@@ -638,7 +638,7 @@ void realToDisplayString2(const void *real, bool_t real34, char *displayString)
else { // zero or positive exponent
for(digitCount=exponent, digitPointer=firstDigit; digitPointer<=firstDigit + min(exponent + (int16_t)displayFormatDigits, 15); digitPointer++, digitCount--) {
if(digitCount!=-1 && digitCount!=exponent && groupingGap!=0 && modulo(digitCount, (uint16_t)groupingGap) == (uint16_t)groupingGap - 1) {
memcpy(displayString + charIndex, NUM_SPACE_PUNCTUATION, 2);
memcpy(displayString + charIndex, STD_SPACE_PUNCTUATION, 2);
charIndex += 2;
}
......@@ -719,7 +719,7 @@ void realToDisplayString2(const void *real, bool_t real34, char *displayString)
// Significant digits
for(digitCount=-1, digitPointer=firstDigit+1; digitPointer<firstDigit+min(numDigits, digitsToDisplay+1); digitPointer++, digitCount--) {
if(!firstDigitAfterPeriod && groupingGap!=0 && modulo(digitCount, (uint16_t)groupingGap) == (uint16_t)groupingGap - 1) {
memcpy(displayString + charIndex, NUM_SPACE_PUNCTUATION, 2);
memcpy(displayString + charIndex, STD_SPACE_PUNCTUATION, 2);
charIndex += 2;
}
else {
......@@ -732,7 +732,7 @@ void realToDisplayString2(const void *real, bool_t real34, char *displayString)
// The ending zeros
for(digitPointer=0; digitPointer<=digitsToDisplay-numDigits; digitPointer++, digitCount--) {
if(!firstDigitAfterPeriod && groupingGap!=0 && modulo(digitCount, (uint16_t)groupingGap) == (uint16_t)groupingGap - 1) {
memcpy(displayString + charIndex, NUM_SPACE_PUNCTUATION, 2);
memcpy(displayString + charIndex, STD_SPACE_PUNCTUATION, 2);
charIndex += 2;
}
else {
......@@ -811,7 +811,7 @@ void realToDisplayString2(const void *real, bool_t real34, char *displayString)
// Digits after radix mark
for(digitCount=-1, digitPointer=firstDigit; digitPointer<firstDigit+min(numDigits, digitsToDisplay+1); digitPointer++, digitCount--) {
if(!firstDigitAfterPeriod && groupingGap!=0 && modulo(digitCount, (uint16_t)groupingGap) == (uint16_t)groupingGap - 1) {
memcpy(displayString + charIndex, NUM_SPACE_PUNCTUATION, 2);
memcpy(displayString + charIndex, STD_SPACE_PUNCTUATION, 2);
charIndex += 2;
}
else {
......@@ -824,7 +824,7 @@ void realToDisplayString2(const void *real, bool_t real34, char *displayString)
// The ending zeros
for(digitPointer=0; digitPointer<=digitsToDisplay-max(0, numDigits); digitPointer++, digitCount--) {
if(!firstDigitAfterPeriod && groupingGap!=0 && modulo(digitCount, (uint16_t)groupingGap) == (uint16_t)groupingGap - 1) {
memcpy(displayString + charIndex, NUM_SPACE_PUNCTUATION, 2);
memcpy(displayString + charIndex, STD_SPACE_PUNCTUATION, 2);
charIndex += 2;
}
else {
......@@ -922,8 +922,8 @@ void complex16ToDisplayString2(const complex16_t *complex16, char *displayString
realToDisplayString2(&imag16, false, displayString + i);
if(complexMode == CM_RECTANGULAR) {
if(strncmp(displayString + stringByteLength(displayString) - 2, NUM_SPACE_HAIR, 2) != 0) {
strcat(displayString, NUM_SPACE_HAIR);
if(strncmp(displayString + stringByteLength(displayString) - 2, STD_SPACE_HAIR, 2) != 0) {
strcat(displayString, STD_SPACE_HAIR);
}
if(displayString[i] == '-') {
......@@ -972,8 +972,8 @@ void complex34ToDisplayString2(const complex34_t *complex34, char *displayString
realToDisplayString2(&imag34, true, displayString + i);
if(complexMode == CM_RECTANGULAR) {
if(strncmp(displayString + stringByteLength(displayString) - 2, NUM_SPACE_HAIR, 2) != 0) {
strcat(displayString, NUM_SPACE_HAIR);
if(strncmp(displayString + stringByteLength(displayString) - 2, STD_SPACE_HAIR, 2) != 0) {
strcat(displayString, STD_SPACE_HAIR);
}
if(displayString[i] == '-') {
......@@ -1032,9 +1032,8 @@ void fractionToDisplayString(calcRegister_t regist, char *displayString) {
gap = 0;
endingZero++;
memmove(displayString + insertAt + 2, displayString + insertAt, endingZero++ - insertAt);
//strncpy(displayString + insertAt, NUM_SPACE_PUNCTUATION, 2);
*(displayString + insertAt) = *(NUM_SPACE_PUNCTUATION);
*(displayString + insertAt + 1) = *(NUM_SPACE_PUNCTUATION + 1);
*(displayString + insertAt) = *(STD_SPACE_PUNCTUATION);
*(displayString + insertAt + 1) = *(STD_SPACE_PUNCTUATION + 1);
}
u = intPart % 10;
......@@ -1044,13 +1043,13 @@ void fractionToDisplayString(calcRegister_t regist, char *displayString) {
displayString[insertAt] = '0' + u;
} while(intPart != 0);
strcat(displayString, NUM_SPACE_PUNCTUATION);
strcat(displayString, STD_SPACE_PUNCTUATION);
endingZero += 2;
}
else { // FT_IMPROPER d/c
if(sign == -1) {
strcpy(displayString, NUM_SUP_MINUS);
strcpy(displayString, STD_SUP_MINUS);
endingZero = 2;
}
else {
......@@ -1068,9 +1067,8 @@ void fractionToDisplayString(calcRegister_t regist, char *displayString) {
gap = 0;
endingZero++;
memmove(displayString + insertAt + 2, displayString + insertAt, endingZero++ - insertAt);
//strncpy(displayString + insertAt, NUM_SPACE_PUNCTUATION, 2);
*(displayString + insertAt) = *(NUM_SPACE_PUNCTUATION);
*(displayString + insertAt + 1) = *(NUM_SPACE_PUNCTUATION + 1);
*(displayString + insertAt) = *(STD_SPACE_PUNCTUATION);
*(displayString + insertAt + 1) = *(STD_SPACE_PUNCTUATION + 1);
}
u = numer % 10;
......@@ -1079,21 +1077,18 @@ void fractionToDisplayString(calcRegister_t regist, char *displayString) {
memmove(displayString + insertAt + 2, displayString + insertAt, endingZero++ - insertAt);
if(u <= 1) {
//strncpy(displayString + insertAt, NUM_SUP_0, 2);
*(displayString + insertAt) = *(NUM_SUP_0);
*(displayString + insertAt + 1) = *(NUM_SUP_0 + 1);
*(displayString + insertAt) = *(STD_SUP_0);
*(displayString + insertAt + 1) = *(STD_SUP_0 + 1);
displayString[insertAt + 1] += u;
}
else if(u <= 3) {
//strncpy(displayString + insertAt, NUM_SUP_2, 2);
*(displayString + insertAt) = *(NUM_SUP_2);
*(displayString + insertAt + 1) = *(NUM_SUP_2 + 1);
*(displayString + insertAt) = *(STD_SUP_2);
*(displayString + insertAt + 1) = *(STD_SUP_2 + 1);
displayString[insertAt + 1] += u - 2;
}
else {
//strncpy(displayString + insertAt, NUM_SUP_4, 2);
*(displayString + insertAt) = *(NUM_SUP_4);
*(displayString + insertAt + 1) = *(NUM_SUP_4 + 1);
*(displayString + insertAt) = *(STD_SUP_4);
*(displayString + insertAt + 1) = *(STD_SUP_4 + 1);
displayString[insertAt + 1] += u - 4;
}
......@@ -1114,27 +1109,25 @@ void fractionToDisplayString(calcRegister_t regist, char *displayString) {
gap = 0;
endingZero++;
memmove(displayString + insertAt + 2, displayString + insertAt, endingZero++ - insertAt);
//strncpy(displayString + insertAt, NUM_SPACE_PUNCTUATION, 2);
*(displayString + insertAt) = *(NUM_SPACE_PUNCTUATION);
*(displayString + insertAt + 1) = *(NUM_SPACE_PUNCTUATION + 1);
*(displayString + insertAt) = *(STD_SPACE_PUNCTUATION);
*(displayString + insertAt + 1) = *(STD_SPACE_PUNCTUATION + 1);
}
u = denom % 10;
denom /= 10;
endingZero++;
memmove(displayString + insertAt + 2, displayString + insertAt, endingZero++ - insertAt);
//strncpy(displayString + insertAt, NUM_SUB_0, 2);
*(displayString + insertAt) = *(NUM_SUB_0);
*(displayString + insertAt + 1) = *(NUM_SUB_0 + 1);
*(displayString + insertAt) = *(STD_SUB_0);
*(displayString + insertAt + 1) = *(STD_SUB_0 + 1);
displayString[insertAt + 1] += u;
} while(denom != 0);
// Comparison sign
if(lessEqualGreater == -1) strcat(displayString, NUM_SPACE_PUNCTUATION "<" NUM_SPACE_HAIR);
else if(lessEqualGreater == 0) strcat(displayString, NUM_SPACE_PUNCTUATION "=" NUM_SPACE_HAIR);
else if(lessEqualGreater == 1) strcat(displayString, NUM_SPACE_PUNCTUATION ">" NUM_SPACE_HAIR);
if(lessEqualGreater == -1) strcat(displayString, STD_SPACE_PUNCTUATION "<" STD_SPACE_HAIR);
else if(lessEqualGreater == 0) strcat(displayString, STD_SPACE_PUNCTUATION "=" STD_SPACE_HAIR);
else if(lessEqualGreater == 1) strcat(displayString, STD_SPACE_PUNCTUATION ">" STD_SPACE_HAIR);
else {
strcat(displayString, NUM_SPACE_PUNCTUATION "?");
strcat(displayString, STD_SPACE_PUNCTUATION "?");
sprintf(errorMessage, "In function fractionToDisplayString: %d is an unexpected value for lessEqualGreater!", lessEqualGreater);
displayBugScreen(errorMessage);
}
......@@ -1427,7 +1420,7 @@ void shortIntegerToDisplayString(calcRegister_t regist, char *displayString, con
}
displayString[j] = 0;
strcat(displayString, NUM_BASE_2);
strcat(displayString, STD_BASE_2);
displayString[strlen(displayString) - 1] += base - 2;
if(stringWidth(displayString, *font, false, false) < SCREEN_WIDTH) {
......@@ -1450,7 +1443,7 @@ void shortIntegerToDisplayString(calcRegister_t regist, char *displayString, con
}
displayString[j] = 0;
strcat(displayString, NUM_BASE_2);
strcat(displayString, STD_BASE_2);
displayString[strlen(displayString) - 1] += base - 2;
if(stringWidth(displayString, *font, false, false) < SCREEN_WIDTH) {
......@@ -1471,7 +1464,7 @@ void shortIntegerToDisplayString(calcRegister_t regist, char *displayString, con
}
displayString[j] = 0;
strcat(displayString, NUM_BASE_2);
strcat(displayString, STD_BASE_2);
displayString[strlen(displayString) - 1] += base - 2;
if(stringWidth(displayString, *font, false, false) < SCREEN_WIDTH) {
......@@ -1498,7 +1491,7 @@ void shortIntegerToDisplayString(calcRegister_t regist, char *displayString, con
}
displayString[j] = 0;
strcat(displayString, NUM_BASE_2);
strcat(displayString, STD_BASE_2);
displayString[strlen(displayString) - 1] += base - 2;
if(stringWidth(displayString, &standardFont, false, false) < SCREEN_WIDTH) {
......@@ -1527,7 +1520,7 @@ void shortIntegerToDisplayString(calcRegister_t regist, char *displayString, con
}
displayString[j] = 0;
strcat(displayString, NUM_BASE_2);
strcat(displayString, STD_BASE_2);
displayString[strlen(displayString) - 1] += base - 2;
if(stringWidth(displayString, *font, false, false) < SCREEN_WIDTH) {
......@@ -1554,7 +1547,7 @@ void shortIntegerToDisplayString(calcRegister_t regist, char *displayString, con
}
displayString[j] = 0;
strcat(displayString, NUM_BASE_2);
strcat(displayString, STD_BASE_2);
displayString[strlen(displayString) - 1] += base - 2;
if(stringWidth(displayString, *font, false, false) < SCREEN_WIDTH) {
......
......@@ -53,759 +53,7 @@ typedef struct {
int16_t findGlyph (const font_t *font, uint16_t charCode);
void generateNotFoundGlyph(const int16_t font, uint16_t charCode);
//<-------- Numeric font glyphs ----------> <---------- Standard font glyphs ---------->
#define NUM_SPACE "\x20"
#define STD_SPACE "\x20"
#define NUM_EXCLAMATION_MARK "\x21"
#define STD_EXCLAMATION_MARK "\x21"
#define NUM_DOUBLE_QUOTE "\x22"
#define STD_DOUBLE_QUOTE "\x22"
#define NUM_NUMBER_SIGN "\x23"
#define STD_NUMBER_SIGN "\x23"
#define STD_DOLLAR "\x24"
#define NUM_PERCENT "\x25"
#define STD_PERCENT "\x25"
#define STD_AMPERSAND "\x26"
#define NUM_QUOTE "\x27"
#define STD_QUOTE "\x27"
#define NUM_LEFT_PARENTHESIS "\x28"
#define STD_LEFT_PARENTHESIS "\x28"
#define NUM_RIGHT_PARENTHESIS "\x29"
#define STD_RIGHT_PARENTHESIS "\x29"
#define NUM_ASTERISK "\x2a"
#define STD_ASTERISK "\x2a"
#define NUM_PLUS "\x2b"
#define STD_PLUS "\x2b"
#define NUM_COMMA "\x2c"
#define STD_COMMA "\x2c"
#define NUM_MINUS "\x2d"
#define STD_MINUS "\x2d"
#define NUM_PERIOD "\x2e"
#define STD_PERIOD "\x2e"
#define NUM_SLASH "\x2f"
#define STD_SLASH "\x2f"
#define NUM_0 "\x30"
#define STD_0 "\x30"
#define NUM_1 "\x31"
#define STD_1 "\x31"
#define NUM_2 "\x32"
#define STD_2 "\x32"
#define NUM_3 "\x33"
#define STD_3 "\x33"
#define NUM_4 "\x34"
#define STD_4 "\x34"
#define NUM_5 "\x35"
#define STD_5 "\x35"
#define NUM_6 "\x36"
#define STD_6 "\x36"
#define NUM_7 "\x37"
#define STD_7 "\x37"
#define NUM_8 "\x38"
#define STD_8 "\x38"
#define NUM_9 "\x39"
#define STD_9 "\x39"
#define NUM_COLON "\x3a"
#define STD_COLON "\x3a"
#define NUM_SEMICOLON "\x3b"
#define STD_SEMICOLON "\x3b"
#define NUM_LESS_THAN "\x3c"
#define STD_LESS_THAN "\x3c"
#define NUM_EQUAL "\x3d"
#define STD_EQUAL "\x3d"
#define NUM_GREATER_THAN "\x3e"
#define STD_GREATER_THAN "\x3e"
#define NUM_QUESTION_MARK "\x3f"
#define STD_QUESTION_MARK "\x3f"
#define STD_AT "\x40"
#define NUM_A "\x41"
#define STD_A "\x41"
#define NUM_B "\x42"
#define STD_B "\x42"
#define NUM_C "\x43"
#define STD_C "\x43"
#define NUM_D "\x44"
#define STD_D "\x44"
#define NUM_E "\x45"
#define STD_E "\x45"
#define NUM_F "\x46"
#define STD_F "\x46"
#define NUM_G "\x47"
#define STD_G "\x47"
#define NUM_H "\x48"
#define STD_H "\x48"
#define NUM_I "\x49"
#define STD_I "\x49"
#define NUM_J "\x4a"
#define STD_J "\x4a"
#define NUM_K "\x4b"
#define STD_K "\x4b"
#define NUM_L "\x4c"
#define STD_L "\x4c"
#define NUM_M "\x4d"
#define STD_M "\x4d"
#define NUM_N "\x4e"
#define STD_N "\x4e"
#define NUM_O "\x4f"
#define STD_O "\x4f"
#define NUM_P "\x50"
#define STD_P "\x50"
#define NUM_Q "\x51"
#define STD_Q "\x51"
#define NUM_R "\x52"
#define STD_R "\x52"
#define NUM_S "\x53"
#define STD_S "\x53"
#define NUM_T "\x54"
#define STD_T "\x54"
#define NUM_U "\x55"
#define STD_U "\x55"
#define NUM_V "\x56"
#define STD_V "\x56"
#define NUM_W "\x57"
#define STD_W "\x57"
#define NUM_X "\x58"
#define STD_X "\x58"
#define NUM_Y "\x59"
#define STD_Y "\x59"
#define NUM_Z "\x5a"
#define STD_Z "\x5a"
#define NUM_LEFT_SQUARE_BRACKET "\x5b"
#define STD_LEFT_SQUARE_BRACKET "\x5b"
#define STD_BACK_SLASH "\x5c"
#define NUM_RIGHT_SQUARE_BRACKET "\x5d"
#define STD_RIGHT_SQUARE_BRACKET "\x5d"
#define NUM_CIRCUMFLEX "\x5e"
#define STD_CIRCUMFLEX "\x5e"
#define NUM_UNDERSCORE "\x5f"
#define STD_UNDERSCORE "\x5f"
#define NUM_a "\x61"
#define STD_a "\x61"
#define NUM_b "\x62"
#define STD_b "\x62"
#define NUM_c "\x63"
#define STD_c "\x63"
#define NUM_d "\x64"
#define STD_d "\x64"
#define NUM_e "\x65"
#define STD_e "\x65"
#define NUM_f "\x66"
#define STD_f "\x66"
#define NUM_g "\x67"
#define STD_g "\x67"
#define NUM_h "\x68"
#define STD_h "\x68"
#define NUM_i "\x69"
#define STD_i "\x69"
#define NUM_j "\x6a"
#define STD_j "\x6a"
#define NUM_k "\x6b"
#define STD_k "\x6b"
#define NUM_l "\x6c"
#define STD_l "\x6c"
#define NUM_m "\x6d"
#define STD_m "\x6d"
#define NUM_n "\x6e"
#define STD_n "\x6e"
#define NUM_o "\x6f"
#define STD_o "\x6f"
#define NUM_p "\x70"
#define STD_p "\x70"
#define NUM_q "\x71"
#define STD_q "\x71"
#define NUM_r "\x72"
#define STD_r "\x72"
#define NUM_s "\x73"
#define STD_s "\x73"
#define NUM_t "\x74"
#define STD_t "\x74"
#define NUM_u "\x75"
#define STD_u "\x75"
#define NUM_v "\x76"
#define STD_v "\x76"
#define NUM_w "\x77"
#define STD_w "\x77"
#define NUM_x "\x78"
#define STD_x "\x78"
#define NUM_y "\x79"
#define STD_y "\x79"
#define NUM_z "\x7a"
#define STD_z "\x7a"
#define STD_LEFT_CURLY_BRACKET "\x7b"
#define NUM_PIPE "\x7c"
#define STD_PIPE "\x7c"
#define STD_RIGHT_CURLY_BRACKET "\x7d"
#define NUM_TILDE "\x7e"
#define STD_TILDE "\x7e"
#define STD_INVERTED_EXCLAMATION_MARK "\x80\xa1"
#define STD_CENT "\x80\xa2"
#define STD_POUND "\x80\xa3"
#define STD_YEN "\x80\xa5"
#define STD_SECTION "\x80\xa7"
#define STD_OVERFLOW_CARRY "\x80\xa9"
#define STD_SUP_a "\x80\xaa"
#define STD_LEFT_DOUBLE_ANGLE "\x80\xab"
#define STD_NOT "\x80\xac"
#define NUM_DEGREE "\x80\xb0"
#define STD_DEGREE "\x80\xb0"
#define NUM_PLUS_MINUS "\x80\xb1"
#define STD_PLUS_MINUS "\x80\xb1"
#define NUM_SUP_2 "\x80\xb2"
#define STD_SUP_2 "\x80\xb2"
#define NUM_SUP_3 "\x80\xb3"
#define STD_SUP_3 "\x80\xb3"
#define NUM_mu_b "\x80\xb5"
#define STD_mu_b "\x80\xb5"
#define NUM_DOT "\x80\xb7"
#define STD_DOT "\x80\xb7"
#define NUM_SUP_1_b "\x80\xb9"
#define STD_SUP_1_b "\x80\xb9"
#define STD_ORDINAL "\x80\xba"
#define STD_RIGHT_DOUBLE_ANGLE "\x80\xbb"
#define STD_ONE_HALF "\x80\xbc"
#define STD_ONE_QUARTER "\x80\xbd"
#define STD_INVERTED_QUESTION_MARK "\x80\xbf"
#define STD_A_GRAVE "\x80\xc0"
#define STD_A_ACUTE "\x80\xc1"
#define STD_A_CIRC "\x80\xc2"