LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Store value to file in engineering format

Hi there,

i need to save values to a file in engineering format (f.e. 1.234E-3, or
1234E-6...). Is there an easy way to format the value in engineering format
? If i use a format like (sprintf(val_str,"%1.4e", float_val) I don't get
the engineering format :o(

Thanks

Norbert


0 Kudos
Message 1 of 4
(3,178 Views)

Hello Norbert,

you could use the formatting function Fmt. This line of code will do what you are asking for:

Fmt (val_str, "%f[e]", float_val);

The CVI Formatting and Scanning functions are very powerfull tools. Check the LabWindows help on "Formatting Functions" for more information on this function.

 

Message 2 of 4
(3,174 Views)
Hello Wim,

im not absolutely sure, but i think i tried this way to, but also the
Formatting Functions didnt work the way i want. Format in engineering
notification meens in steps like 1 E-3, 1 E-6, 1E-9, 1E-12, but not 1E-2 or
1E-5 and so on, so with this format i can get a scientific notification, but
not an engineering. This is important, because i have to think in steps like
mA or nA or uA (milli Amps, nana amperes or mycro amperes)..

Norbert


"Wim S" <x@no.email> schrieb im Newsbeitrag
news:1166195414889-454704@exchange.ni.com...
> Hello Norbert,
> you could use the formatting function Fmt. This line of code will do what
> you are asking for:
> Fmt (val_str, "%f[e]", float_val);
> The CVI Formatting and Scanning functions are very powerfull tools. Check
> the LabWindows help on "Formatting Functions" for more information on this
> function.
> &nbsp;


0 Kudos
Message 3 of 4
(3,172 Views)

Hi Norbert,

sorry, I misunderstood your question Smiley Sad I'm afraid the Formatting function is unable to do this. I guess you will have to write your own function for this...

0 Kudos
Message 4 of 4
(3,169 Views)