Actions
Bug #2751
closedWDoubleSpinBox setting decimals to zero show decimal point
Start date:
03/04/2014
Due date:
% Done:
0%
Estimated time:
Description
Hi,
I use t WDoubleSpinBox and want to set the decimals depending on some code either to 2 or 0. If I set to zero the decimal point is however included.
I would propose to change the
WString WLocale::toFixedString(double value, int precision) const
method as follows:
Use
ss << std::fixed << ((precision > 0) ? std::showpoint : std::noshowpoint) << value;
instead of
ss << std::fixed << std::showpoint << value;
Also a suffix beginning with "s" of a WDoubleSpinBox will validate any value to invalid and highlights red!?
Updated by Koen Deforche almost 11 years ago
- Status changed from New to InProgress
- Assignee set to Roel Standaert
- Priority changed from Normal to High
Updated by Roel Standaert almost 11 years ago
- Status changed from InProgress to Resolved
Hey,
I made it so that toFixedString doesn't produce a decimal point when precision is 0.
I couldn't reproduce your issue with the "s" suffix, though. For me, it works just fine.
Can you open another issue for that, and maybe provide a test case with more details?
Regards,
Roel
Updated by Stefan Ruppert almost 11 years ago
Updated by Koen Deforche almost 11 years ago
- Status changed from Resolved to Closed
Actions