LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert number to string as currency!

Solved!
Go to solution

Hello I would like to convert a number array with prices into a table string and like to keep the two zeros after the comma if it is an integer number. Is there a tool for that?


0 Kudos
Message 1 of 6
(2,918 Views)

Hi fsteini,

 

like to keep the two zeros after the comma if it is an integer number.

Integer numbers don't have a "comma" (aka decimal separator char aka point in English text) by definition. And they always have "zeros after the comma".

 

Why don't you set the formatting of your numbers to "%.2f"?

Best regards,
GerdW


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

@GerdW wrote:

like to keep the two zeros after the comma if it is an integer number.

Integer numbers don't have a "comma" (aka decimal separator char aka point in English text) by definition. And they always have "zeros after the comma".


In most of Europe, a comma is used as decimal separator (except by programmers).

0 Kudos
Message 3 of 6
(2,889 Views)

Hi wiebe,

 

In most of Europe, a comma is used as decimal separator (except by programmers).

I know as I live in Germany. And I force my collegues to use "English" settings when they want to handle measurement data…

 

But in an English-speaking forum it might be obscure to ask about "zeros after the comma".

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,886 Views)
Solution
Accepted by topic author fsteini

@GerdW wrote:

Hi wiebe,

 

In most of Europe, a comma is used as decimal separator (except by programmers).

I know as I live in Germany. And I force my collegues to use "English" settings when they want to handle measurement data…

 

But in an English-speaking forum it might be obscure to ask about "zeros after the comma".


Hmm. Not sure about that. I feel it is a serious concern for English-speaking people to be aware of it. If it is obscure, it's about time to change that.

 

I always (successfully) try to adapt to the people's wishes. If they want comma's, everything that shows should use comma's. Of course, for everything stored, decimal points is a better choice. Reports are a grey area, and it might need a setting to specify what the user wants.

 

BTW: Getting off topic. %.2f sound like a solution to me.

0 Kudos
Message 5 of 6
(2,872 Views)

Thank You

0 Kudos
Message 6 of 6
(2,814 Views)