Hi...
I have a ARRAY of integers, out of which two integers are showing value of one Float, how can i make it
Hi @viral.patel,
Could you provide more context on what you are trying to do and what is happening? Like an example array?
Right now, I can think of possibilities that the array may have a typo where a ',' may have been typed out as '.' if the array is manually built. If another function is building this array, you can use int() to round it to an integer, and if you are getting 2 int values but in the form of a float for some reason, you can do a .split('.') to make them 2 separate values, but this will create a list, and you'll have to parse through it and .append() to your array.
Combine your INTs to 32 bits using shift and bitwise OR, then run the result through Java's Float.intBitsToFloat() static method. Some inspiration:
i think this assumes that the ints are reliably split along the mantissa/decimal point?
No, that doesn't matter.
It does assume a "word order" that may need to be reversed, though.
i tried with this, but it is showing error with runscript
so i entered direct value of integer to test, can you please guide
runScript()
is part of the expression language. You would use it in a property binding or in an expression tag. If that latter, be sure your function is defined in the gateway scripting project (tags do not have access to all projects).