mirror of
https://github.com/reactos/reactos.git
synced 2024-11-23 03:23:34 +08:00
parent
0d6316b008
commit
30b40247a3
@ -1015,10 +1015,16 @@ static void handle_copy_command(HWND hWnd)
|
||||
TCHAR display[MAX_CALC_SIZE];
|
||||
UINT n;
|
||||
|
||||
// Read current text from output display
|
||||
n = GetDlgItemText(hWnd, IDC_TEXT_OUTPUT, display, SIZEOF(display));
|
||||
|
||||
if (calc.base == IDC_RADIO_DEC && _tcschr(calc.buffer, _T('.')) == NULL)
|
||||
display[n - calc.sDecimal_len] = _T('\0');
|
||||
// Check if result is a true number
|
||||
if (!calc.is_nan)
|
||||
{
|
||||
// Remove trailing decimal point if no decimal digits exist
|
||||
if (calc.base == IDC_RADIO_DEC && _tcschr(calc.buffer, _T('.')) == NULL)
|
||||
display[n - calc.sDecimal_len] = _T('\0');
|
||||
}
|
||||
|
||||
CopyMemToClipboard(display);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user