Previous Topic

Next Topic

Book Contents

Book Index

How Numeric Values are Displayed

Warning: this is a technical topic for advanced users only.

We are often asked how numeric (in particular decimal) values are displayed in AQT, and how to change the way they are displayed. This is a surprisingly complicated area - we describe here how it works.

The are two parts to this discussion:

How Numeric Values are retrieved from the Database

When data is retrieved from the database into AQT, AQT supplies program variables for the data to be placed into (by the ODBC Driver). For numeric variables, AQT has a choice of retrieving them into either:

Most numeric values go into AQT as numbers. Except:

When AQT retrieves the decimal value as a string, it is the ODBC Driver that decides how the decimal value is to be formatted as a string. So, it is the ODBC Driver that decides whether to display the decimal value as (for instance) 12.345 or +1.2345E+1.

Some ODBC Drivers have options that specify how it is to format the decimal values. For instance SQL Server has the setting Use regional settings when outputing currency, number, dates and times. When this option is selected, SQL Server will use the Control Panel regional settings for formatting the decimal values.

How Numeric Values are displayed in the Grid

Once AQT has retrieved the numeric value, it will place the value in the display grid. There are two ways in which the grid works. This is governed by Options > Display Options > Use Correct Data Types for Grid Columns.

Exporting Data

When data is exported, numeric values are written as they have been retrieved from the database.

Decimal Separator is Comma

Databases always return decimal values with a dot as the decimal separator, even in cases where this has been set as a comma in the Regional Settings.

AQT will detect that the Regional Settings have specified a comma, and will replace the dot with a comma in the decimal values that are retrieved from the database.

If you have specified Use Correct Data Types for Grid Columns, the grid will also be aware that the decimal separator is a comma. There has been the odd problem whereby AQT hasn't replaced the dot with a comma when it should have. When this happens, the grid interprets the dot as a grouping-indicator (thousands separator) and has displayed the decimal value as 1000 times the correct value. If you suspect this might be happening to you, switch off Use Correct Data Types for Grid Columns.

Advanced Query Tool
https://www.querytool.com
© 2023 Cardett Associates Ltd. All rights reserved.