Browse Source

refactoring: moved printlf to top of file

remotes/origin/userinput
TheUltimateOptimist 11 months ago
parent
commit
26b0c9cc48
  1. 24
      src/userinput.c

24
src/userinput.c

@ -27,6 +27,18 @@ void printText(char *text) {
}
}
void printlf(long double value) {
if (fakeInput != NULL) {
return;
}
if (roundl(value) == value) {
printf("%.0Lf", value);
}
else {
printf("%Lf", value);
}
}
void trimLeft(char *input) {
size_t length = strlen(input);
int firstIndex = 0;
@ -81,18 +93,6 @@ char *readInput() {
return buffer;
}
void printlf(long double value) {
if (fakeInput != NULL) {
return;
}
if (roundl(value) == value) {
printf("%.0Lf", value);
}
else {
printf("%Lf", value);
}
}
char *gets(char *message, unsigned long *minLength, unsigned long *maxLength) {
printText(message);
char *result = readInput();

Loading…
Cancel
Save