542 views
in Embedded Wizard Studio by
Can i change number to string with comma

Ex 1000 -> "1,000"

1 Answer

0 votes
by

Hello,

you can modify the resulting string and e.g. insert comma signs. The following code demonstrates how to add thousands separatos to a string containing a formatted integer number:

var int32  number = 1234567890;
var string str    = string( number );
var int32  len    = str.length;

for ( ; len > 3; len = len - 3 )
  str = str.insert( ',', len - 3 );

trace str;

At the runtime the code produces following outputs in the Log window:

Does it help you?

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...