[resolved] round a number to the superior integer

One Star

[resolved] round a number to the superior integer

Hello,
I'm trying to use math.round to round a double to the superior interger, for example :
6,2 become 7
5,9 become 6
9 become 9
but math.round just return me :
6,2 become 6
5,9 become 5
9 become 9
Can you help me ?

Accepted Solutions
One Star

Re: [resolved] round a number to the superior integer

Hello,
java.lang.Math.ceil(6.2d)
CF the doc here :
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Math.html

All Replies
One Star

Re: [resolved] round a number to the superior integer

Hello,
java.lang.Math.ceil(6.2d)
CF the doc here :
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Math.html
One Star

Re: [resolved] round a number to the superior integer

Thank you, it work goob (without the 'd'). Why did you put a 'd' ?
Highlighted
One Star

Re: [resolved] round a number to the superior integer

hum, that's weird it should work too.
It forces it to be a double (it could be a float).

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.