Expand my Community achievements bar.

Rounding up numbers in a custom form

Avatar

Level 6
We have created a custom form that contains two calculated fields called Planned Hours and Actual Hours. We have added a conversion formula to show the number in days rather than hours. When you view this custom form attached to a project, both these numbers show up with too many decimal places so we've tried to add an expression to round them to one decimal place but it doesn't seem to do anything. This is the formula we're using, what are we missing? ROUND((Actual Hours/60/7.5),1)
11 Replies

Avatar

Level 10
I don’t think it can do math inline. I think you have to have a discreet value as the first operator (Actual Hours) and not a formula. Eric

Avatar

Level 3
Just for the heck of it, you might try adding some parentheses to it to clarify the order of operations. It might be getting confused by trying to do too much at once. So, something like: ROUND((Actual Hours/60)/7.5,1)

Avatar

Level 6
Ok, so can I round it in a report? If so what expression would I use? Thanks Eric ‚ò∫ Laura Ray Project Support Analyst Bakkavor Information Systems Bakkavor Group West Marsh Road, Spalding, Lincolnshire, PE11 2BB, UK Direct: +44 (0)1775 763 010 www.Bakkavor.com // Laura.Ray@Bakkavor.com< [cid:image001.png@01D1C097.E4BDBE50] [cid:image002.png@01D1C097.E4BDBE50]

Avatar

Level 7
I agree with Kathy in adding parenthesis to the equation. Also, rounding and displaying can be 2 different things. In other words, we have a value the shows 1 decimal. If the true value is 11.111111, if we round to 1, we'll see 11.1 as expected, but if we round to 0, we'll see 11.0, not just 11. (if round to 3, we'll see 11.111). So the question is, is it truely not rounding, or is it showing too many decimal places?

Avatar

Level 10
If you are looking just to get the full day, never mind the decimals.. you can use FLOOR. FLOOR(SUM(1.2345,2)) --> this would just give you 3.

Avatar

Level 6
Hi Greg, good point! It’s actually about showing too many decimal places, I really don’t care about it rounding to be honest, it will be close enough to say 1.1 days, we’ll get the gist from that. Thanks ☺ Laura Ray Project Support Analyst Bakkavor Information Systems Bakkavor Group West Marsh Road, Spalding, Lincolnshire, PE11 2BB, UK Direct: +44 (0)1775 763 010 www.Bakkavor.com // Laura.Ray@Bakkavor.com< [cid:image001.png@01D1C15D.9F609000] [cid:image002.png@01D1C15D.9F609000]

Avatar

Level 6
Thanks Polly, If I can’t get the result to 1 decimal place then I’ll use the ‘FLOOR’ option. ☺ Laura Ray Project Support Analyst Bakkavor Information Systems Bakkavor Group West Marsh Road, Spalding, Lincolnshire, PE11 2BB, UK Direct: +44 (0)1775 763 010 www.Bakkavor.com // Laura.Ray@Bakkavor.com< [cid:image001.png@01D1C15D.B4F46590] [cid:image002.png@01D1C15D.B4F46590]

Avatar

Level 6
We are more interested in displaying to one decimal point that the number being rounded, is this possible in this case Eric?

Avatar

Level 10
Have you tried this? ROUND((DIV(392,60,7.5)),1) where 392 is your actual hours? This shows up 0.9 for me. Cheers.

Avatar

Level 6
Applied this expression and it doesn’t correct the number in either the custom form fields or a report. Open to other suggestions, thanks ☺ Laura Ray Project Support Analyst Bakkavor Information Systems Bakkavor Group West Marsh Road, Spalding, Lincolnshire, PE11 2BB, UK Direct: +44 (0)1775 763 010 www.Bakkavor.com // Laura.Ray@Bakkavor.com< [cid:image001.png@01D1C31C.B6842830] [cid:image002.png@01D1C31C.B6842830]

Avatar

Level 10
Strange. The format on my custom form was Number. Something you might want to check. One other thing that was happening for me is if you did put in the custom form in the project, you have to delete the form on the project and then re-add it to make sure it calculates properly.