02-10-2021 02:54 AM
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
02-10-2021 03:20 AM
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:
Note: I recommended to stick with English numeric formats using the point as decimal separator…
02-10-2021 03:29 AM
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?
02-10-2021 05:10 AM - edited 02-10-2021 05:11 AM
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)