Project

General

Profile

Actions

Bug #2751

closed

WDoubleSpinBox setting decimals to zero show decimal point

Added by Stefan Ruppert almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
High
Assignee:
Roel Standaert
Target version:
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!?

Actions #1

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
Actions #2

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

Actions #3

Updated by Stefan Ruppert almost 11 years ago

Hi,

I filed bug #2752. It seems to me that changing the suffix is the problem...

Regards,

Stefan

Actions #4

Updated by Koen Deforche almost 11 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF