Good day! I implement the calculator on Qt. The following questions arose:
- I used
QString::number(a1, 'f', 10)for output not in exponential form, but in the end I get extra zeros at the end. CanQDoubleValidatorbe used to get rid of zeros? Need control input comma in the number (you can enter only one comma). I think it can be implemented like this:
QString str; int i; QLineEdit *Result = new QLineEdit(this); if (Result->validator()->validate(str,i)==QValidator::Invalid) return;Maybe there is a better way or is it not at all correct?
Thanks for the help and the time spent.
QString::number(a1, 'f', 10)do you get a string with a dot or comma? - cassini