|  | Home · Overviews · Examples

# QDoubleValidator Class Reference
[com.trolltech.qt.gui module]

The `QDoubleValidator` class provides range checking of floating-point numbers. More...

Inherits `QValidator`.

## Detailed Description

The `QDoubleValidator` class provides range checking of floating-point numbers.

`QDoubleValidator` provides an upper bound, a lower bound, and a limit on the number of digits after the decimal point. It does not provide a `fixup` function.

You can set the acceptable range in one call with `setRange`, or with `setBottom` and `setTop`. Set the number of decimal places with `setDecimals`. The `validate` function returns the validation state.

`QDoubleValidator` uses its `locale` to interpret the number. For example, in the German locale, "1,234" will be accepted as the fractional number 1.234. In Arabic locales, `QDoubleValidator` will accept Arabic digits.

In addition, `QDoubleValidator` is always guaranteed to accept a number formatted according to the "C" locale. `QDoubleValidator` will not accept numbers with thousand-seperators.

See also `QIntValidator`, `QRegExpValidator`, and Line Edits Example.