Discussion:
How to get leading zeroes in exponent of e-format
(too old to reply)
altenbach
2008-08-07 01:10:08 UTC
Permalink
In order to mimic an ancient file specification, am trying to write DBL numbers in e-format where the exponent is padded to two digits with leading zeroes.
 
For example:  -1.15091E-0 3
 
Is there a simple format code that does this or do I need to write something from scratch?
Ipshita_C
2008-08-07 22:40:05 UTC
Permalink
Hi Altenbach,
Are you writing the numbers to an indicator or a file?
Ipshita C.
altenbach
2008-08-07 22:40:06 UTC
Permalink
I am writing to a file.
(Currently, I use the following workaround: format as %12.5e, then scan the substring after the "E", format it as %+03d, and recombine with the mantissa)
Ipshita_C
2008-08-11 15:10:06 UTC
Permalink
Hi Altenbach,
 
What you require is parsing the bits in your number to put them in your desired format. LabView does not have any parsing functions that can output in the format that you want. You can do the parsing in a dll written in C where you enforce the display of the mantissa and exponent and then call that in LabView using a Call Library Function Node. Hope this helps.
 
Ipshita C.

Continue reading on narkive:
Loading...