Link to home
Start Free TrialLog in
Avatar of PNKJ
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,@number)/1000, 0)
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi PNKJ,
On the face of it, all you need is a formula field with:

Round(@number/1000,0)

Pete
Avatar of PNKJ
PNKJ

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
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Avatar of PNKJ

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
What is @number?
Avatar of PNKJ

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
Avatar of PNKJ

ASKER

I wrote this in formula editor and i get error boolean is required
If {datatable.section} = 1 or Trim({data_table.section_name}) = "yearly report" then
Round({datatable.meatproducts}/1000,0)and
Round({datatable.vegetables}/1000,0)
it is 'and' or 'else you are using in the formula? Replace 'and' with 'else' if you are using 'and' in the formula

Gary
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial