LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change scientific number format to E-5 format?

Hello,

 

How can i force labview to handle the float point numbers as E-5 format?

 

E.g.: labview saves numbers to data base:

1,50E-4

8,27E-5

2,30E-4

9,09E-5

 

Can i select 'E-5' format?

 

Kind regards,

Balázs

0 Kudos
Message 1 of 4
(2,051 Views)

Hi LTBalazs,

 


@LTBALAZS wrote:

E.g.: labview saves numbers to data base:

1,50E-4

8,27E-5

2,30E-4

9,09E-5

 

Can i select 'E-5' format?


What is a "E-5" format?

LabVIEW knows about scientific format, as you seem to have used to save data. And it knows to use the scientific format with exponents of multiples of 3 (E+0, E-3, E-6).

 

When you need something special like this (saving data scaled to 10µ) then you need to implement it on your own:

  • scale your data by 1E+5
  • format using %.2f and append "E-5" to the resulting string

Note: I recommended to stick with English numeric formats using the point as decimal separator…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,045 Views)

A format is just a cosmetic property and only makes sense if the output is a string. What is the datatype of these values in your database?

 

Never heard of E-5 format. What does e.g. the "E", the "-", and the "5" mean? How would a E-4 formatted number look like? How about E+9? Do you have a link to a description?

0 Kudos
Message 3 of 4
(2,038 Views)

As the others said, there is no way to stick to E-5.

 

But.. you say you are writiing to a datasbase. What kind of database, and how do you do it?

 

A database, even Excel,knows the difference between a number and a string. Normally, you want a numerical value to be stored as number in a database, because then you can do some math on it. Further more, it does not matter if you send the value as 0.00003, 3E-5 or 30E-6, because this is understood by the database. And it is up to whatever-tool-is-used to display the value in the desired format.

Only if the number is stored as text - either because the column in the database is a text field, or because your database is a CSV (=text) field, you have to deal with this, and write your own code to format the number as desired.

 

(And one hint:   If you use FormatIntoString, use "%.;The value is %f". The %.; enforces LV to use a decimal point instead of comma)

0 Kudos
Message 4 of 4
(2,011 Views)