Welcome! Log In Create A New Profile

Advanced

numtostring display 9,999,999.99

Posted by PETER ZHOU 
PETER ZHOU
numtostring display 9,999,999.99
September 06, 2019 05:03PM
Hi,

How to have the NumToString to display e.g. 9,999,999.99 ( thousands group as comma )?

Regards,

PETER ZHOU
Re: numtostring display 9,999,999.99
September 06, 2019 06:25PM
Hi Peter,

Use NumToString(your_number_var, maskSystemNumeral)

Regards,

Vassilis



Edited 1 time(s). Last edit at 09/06/2019 06:26PM by Vassilis.
PETER ZHOU
Re: numtostring display 9,999,999.99
September 06, 2019 07:18PM
Vassilis Wrote:
-------------------------------------------------------
> Hi Peter,
>
> Use NumToString(your_number_var,
> maskSystemNumeral)
>
> Regards,
>
> Vassilis

Hi Vassilis,

Use NumToString(your_number_var, maskSystemNumeral) doesn't work ( even though my system uses the comma as thousand group )

same for NumToString(your_number_var, maskSystemCurrency), it doesn't work.

Regards,

Peter Zhou
Re: numtostring display 9,999,999.99
September 06, 2019 08:59PM
Hi Peter,

Would you try with currency variable ?

Regards
Vassilis
PETER ZHOU
Re: numtostring display 9,999,999.99
September 10, 2019 04:49AM
Vassilis Wrote:
-------------------------------------------------------
> Hi Peter,
>
> Would you try with currency variable ?
>
> Regards
> Vassilis


Hi Vassilis,

Sorry, I dont understand what you meant by currency variable ?

Regards,

Peter Zhou
Re: numtostring display 9,999,999.99
September 10, 2019 06:56AM
Hi Peter,

After experimentation I found a simple solution.

1. ValStr is string = NumToString(you_number_var, "10,2fs" // gives e.g. 65.280,25
2. Replace(ValStr, ",", "_") // replaces the "," with "_", so the result is 65.280_25
2. Replace(ValStr, ".", ",") // gives 65,280_25
3. Replace(ValStr, "_", ".") // gives the disired result 62,280.25

Best Regards

Vassilis
Re: numtostring display 9,999,999.99
September 12, 2019 08:26PM
Hi,
I just needed that today and maskSystemNumeral works for me (see picture).

Edit: I have change . and , in regional settings and it changed numtostring result.

BR,
Alen



Edited 1 time(s). Last edit at 09/12/2019 08:31PM by slxslx.
Attachments:
open | download - numtostring.png (53.6 KB)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: