From 26b0c9cc488319a577004004e47b6597762193c6 Mon Sep 17 00:00:00 2001 From: TheUltimateOptimist Date: Mon, 29 Jan 2024 01:41:25 +0100 Subject: [PATCH] refactoring: moved printlf to top of file --- src/userinput.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/userinput.c b/src/userinput.c index 41bf30d..1269cb1 100644 --- a/src/userinput.c +++ b/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();