View Full Version : number of decimal


Andrej
10-22-2007, 01:04 AM
have a problem in the report with a number of decimal
for instance, need to have a 2 decimal number in the column of numbers, but data in the column not is always number(<0.01)
any idea how can I get in the column of report with 2 decimal numbers in combination with strings

llkhoutx
10-22-2007, 10:28 AM
Just set the fields Format Property to "Standard" and the Decimal Points property to "2", both without the quotation marks.

Andrej
10-22-2007, 11:30 PM
thanks for advice, but if the field has strings and the numbers, setting this format doesn't shows 2 decimal.

llkhoutx
10-23-2007, 04:04 AM
First of all you table isn't normalized if it contains two data types. This will bite you when you least expect it.

You can use a conditional if statement to format the numeric values.

Andrej
10-26-2007, 04:07 AM
sorry for the late response,
the table is normalized, but the query it's modified in the sense that change the column in string type because the minimum has to be presented like <0.01 value.
numbers has a problem when value is 4.00 in the report is presented like 4.
is it possible to change that?

llkhoutx
10-26-2007, 05:27 AM
The query column should be

ColumnName:iif(QueryFieldName < 0.01, "<0.01",format(QueryFieldName,"#,##0.00")

This sets the field to "<0.01" when the QueryFieldName value is less than 0.01; otherwise the QueryFieldName value is displayed formatted correctly.

"#,##0.00" guarantees any number will be displayed in standard format with 2 decimals, i.e.

0.09 will display as "<0.01" a string.
25 will display as 25.00, a number.
1234.5678 will display as 1,234.57 (rounded), a number.

Having mixed datatypes in a single query column can potentially cause a multitude of probems which you obviously haven't stumbled onto yet.

Good luck

Andrej
10-29-2007, 02:58 AM
it works,
this is great, thank you.
it really helps me a lot