Skip to content

Commit

Permalink
fix bug exponential number
Browse files Browse the repository at this point in the history
  • Loading branch information
apinprastya committed Feb 25, 2020
1 parent 56a8133 commit ddf42b3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions libgui/moneylineedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/
#include "moneylineedit.h"
#include "preference.h"
#include "global_setting_const.h"
#include <QDoubleValidator>
#include <QLocale>
#include <QDebug>
Expand Down Expand Up @@ -50,10 +51,7 @@ double MoneyLineEdit::value()
void MoneyLineEdit::setValue(double value)
{
QLocale locale;
if(locale.decimalPoint() == QChar(','))
setText(QString::number(value).replace(".", ","));
else
setText(QString::number(value));
setText(locale.toString(value, 'f', LibG::Preference::getInt(LibG::SETTING::LOCALE_DECIMAL)));
}

void MoneyLineEdit::textHasChanged(const QString &value)
Expand Down

0 comments on commit ddf42b3

Please sign in to comment.