3 Replies Latest reply: Apr 28, 2015 3:22 AM by Joanna Seldon

# rounding off number figure problem

Hiya

I need to stop a sum from rounding off a number

e.g the correct answer should show 5.5...but I get 6

can you please show me how I can edit this code below to stop this

num( sum(Target), \$(= chr(39) & \$(=\$(vFormat)) & chr(39)))

note: this part is needed to convert number to percentage (= chr(39) & \$(=\$(vFormat)) & chr(39)))

Kind Regards

Joeybird

• ###### Re: rounding off problem

Hi JoeyBird,

Can you post an example qvw

andy

• ###### Re: rounding off number figure problem

I think this is related to an earlier post .

If that is true and you used a vFormat variable with this definition...

set vFormat='if(Only(Format)=' & chr(39) & 'Integer' & chr(39) &',' &chr(39)& '#,##0' & chr(39) & ',' & chr(39) & '#,##0%' & chr(39) & ')';

...then try changing

#,##0%

to

#,###.0%

or

#,###.#0%

(the last has 2 decimals, the 2nd last has 1 decimal)

• ###### Re: rounding off number figure problem

hiya

#,###.0%

worked!!!!

awesome possum!!!

thanks again x

Kind Regard

joeybird