You need to sign in to do that
Don't have an account?
willing
Convert a double to Integer
I need to multiply two numbers , one of them is integer and other is Double.
It is not allowing me to multiply.
I am using the following syntax currently: time_cov is double
Integer.valueOf(String.valueOf(time_cov ))
It does not error out but is not giving me result.
Is there a better way or any other way.
Thanks
It is not allowing me to multiply.
I am using the following syntax currently: time_cov is double
Integer.valueOf(String.valueOf(time_cov ))
It does not error out but is not giving me result.
Is there a better way or any other way.
Thanks
In Java you would use the cast operator to perform multiplication between ints, and doubles.
I haven't found any documentation for this but it seems Apex handles the cast for you.
I tested and this works:
And this works:
Hope this helps
It did work