We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d6316b commit 30b4024Copy full SHA for 30b4024
base/applications/calc/winmain.c
@@ -1015,10 +1015,16 @@ static void handle_copy_command(HWND hWnd)
1015
TCHAR display[MAX_CALC_SIZE];
1016
UINT n;
1017
1018
+ // Read current text from output display
1019
n = GetDlgItemText(hWnd, IDC_TEXT_OUTPUT, display, SIZEOF(display));
1020
- if (calc.base == IDC_RADIO_DEC && _tcschr(calc.buffer, _T('.')) == NULL)
1021
- display[n - calc.sDecimal_len] = _T('\0');
+ // Check if result is a true number
1022
+ if (!calc.is_nan)
1023
+ {
1024
+ // Remove trailing decimal point if no decimal digits exist
1025
+ if (calc.base == IDC_RADIO_DEC && _tcschr(calc.buffer, _T('.')) == NULL)
1026
+ display[n - calc.sDecimal_len] = _T('\0');
1027
+ }
1028
1029
CopyMemToClipboard(display);
1030
}
0 commit comments