[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).

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads