04-04-2012 09:43 AM
Hi: - I’m hoping someone can help.
I have a string containing a float number “3.5266287875071523e-38”
I need to convert this to a 32 bit HEX string. From http://babbage.cs.qc.edu/IEEE-754/ I know the correct answer is 0x”01400208”.
I can easily get the 64-bit answer (3828 0041 0000 0000)
I’ve searched and searched the web - I tried many different approaches – all without success. The closest I've been able to get is the attached VI. I think I’m missing a nugget of knowledge.
Thanx to whomever can take some time and get me un-stuck
Solved! Go to Solution.
04-04-2012 09:57 AM
04-04-2012 09:58 AM
Just wire a SGL constant to the Default input of Fract/exp String to number.
(that will give you a 32 bit IEEE-754 represttation- and then when the SGL is flattened you get
04-04-2012 10:16 AM
Thanx guys - both of you: BOTH solutions are good - either let the stringToNumber conversion create the single or convert it after the fact. As GerdW points out, the nugget I was missing was that SGL are 32 bit. I appreciate your time
I won't admit to how long I tried to solve this and embarrased to find that the answer is so straightforward <blush>