Project

General

Profile

Actions

Bug #2751

closed
SR RS

WDoubleSpinBox setting decimals to zero show decimal point

Bug #2751: WDoubleSpinBox setting decimals to zero show decimal point

Added by Stefan Ruppert over 12 years ago. Updated over 12 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!?

KD Updated by Koen Deforche over 12 years ago Actions #1

  • Status changed from New to InProgress
  • Assignee set to Roel Standaert
  • Priority changed from Normal to High

RS Updated by Roel Standaert over 12 years ago Actions #2

  • 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

SR Updated by Stefan Ruppert over 12 years ago Actions #3

Hi,

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

Regards,
Stefan

KD Updated by Koen Deforche over 12 years ago Actions #4

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom