PNKJ
asked on
formula to round number
Hi
I am using the following to convert to get rounded numbers in my stored procedure. How can I do the same in crystal report editor and what is the formula for the same. How do you get to the editor
convert(int, round(convert(float,@numbe r)/1000, 0)
I am using the following to convert to get rounded numbers in my stored procedure. How can I do the same in crystal report editor and what is the formula for the same. How do you get to the editor
convert(int, round(convert(float,@numbe
ASKER
Thanks but where do you write this formula I am trying to click on the column field and format not sure if i am right
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
A little help with creating a formula
Display the field insertion popup
Click the FORMULA Tab
Click NEW (may have to right click)
Name - MyRoundedNumber
Formula
As Above
Click SAVE
Close the formula editor
Drag the formula onto the report and delete your other field
mlmcc
Display the field insertion popup
Click the FORMULA Tab
Click NEW (may have to right click)
Name - MyRoundedNumber
Formula
As Above
Click SAVE
Close the formula editor
Drag the formula onto the report and delete your other field
mlmcc
ASKER
Whenever i try to save it says ) is missing there is error in formula i wen tto feild explorer right click formula fields
Selected new gave the name and the formula editor opened .
I typed Round(@number/1000,0)
when trying to save it gices error ) is missing
Selected new gave the name and the formula editor opened .
I typed Round(@number/1000,0)
when trying to save it gices error ) is missing
What is @number?
ASKER
From data table i have meatproducts, groceries etc these are the colomn names and are returned as such from database for eg datatable_meatproducts
ASKER
I wrote this in formula editor and i get error boolean is required
If {datatable.section} = 1 or Trim({data_table.section_n ame}) = "yearly report" then
Round({datatable.meatprodu cts}/1000, 0)and
Round({datatable.vegetable s}/1000,0)
If {datatable.section} = 1 or Trim({data_table.section_n
Round({datatable.meatprodu
Round({datatable.vegetable
it is 'and' or 'else you are using in the formula? Replace 'and' with 'else' if you are using 'and' in the formula
Gary
Gary
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
On the face of it, all you need is a formula field with:
Round(@number/1000,0)
Pete