SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Number Formatting Question

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Number Formatting Question
Author Message
Stephen Marchlik



Joined: 09 Aug 2001
Posts: 10

Post Number Formatting Question Reply with quote

I am trying to take a number variable and send the value to a string with the number formatted with commas.

EX:

Let's say that the file size of BLAH.txt is 100,500,300 bytes...

DIM FINAL_FILEPATH, STRING "C:\\WINDOWS\\DESKTOP\BLAH.TXT\"
DIM UNZIP_SIZE, NUMBER
DIM FINAL_FILE_BYTE_SIZE, STRING

FILESIZE( FINAL_FILEPATH, UNZIP_SIZE )

--> now the variable UNZIP_SIZE should contain a NUMBER value of 100500300.

SET FINAL_FILE_BYTE_SIZE, UNZIP_SIZE

--> now the variable FINAL_FILE_BYTE_SIZE should contain a STRING value of

100500300.

Question: How can I make the string value in FINAL_FILE_BYTE_SIZE be displayed as 100,500,300?

I see in the help docs that the comma "," format symbol can be used. But how? Essentiall what I want to do is similar to pressing the button in MS Excel to convert a number from general to comma formatted. Thoughts?

Here is what Help gave for info on it...

Thanks,
SM

********HELP*******

, (comma) Thousands separator. If the format contains commas separated by #'s or 0's, the number is output with commas separating thousands. A comma following a placeholder scales the number by a thousand. For Example, the format 0, scales the number by 1000 (e.g., 10,000 would be converted as 10).


Sun Sep 16, 2001 1:22 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: Number Formatting Question Reply with quote

You can use Format statement for this purpose, for example

Format(UNZIP_SIZE, "#,##0", FINAL_FILE_BYTE_SIZE)

: I am trying to take a number variable and send the value to a string with the
: number formatted with commas.

: EX: Let's say that the file size of BLAH.txt is 100,500,300 bytes...

: DIM FINAL_FILEPATH, STRING "C:\\WINDOWS\\DESKTOP\BLAH.TXT\"
: DIM UNZIP_SIZE, NUMBER
: DIM FINAL_FILE_BYTE_SIZE, STRING

: FILESIZE( FINAL_FILEPATH, UNZIP_SIZE )

: --> now the variable UNZIP_SIZE should contain a NUMBER value of
: 100500300.

: SET FINAL_FILE_BYTE_SIZE, UNZIP_SIZE

: --> now the variable FINAL_FILE_BYTE_SIZE should contain a STRING value of

: 100500300.

: Question: How can I make the string value in FINAL_FILE_BYTE_SIZE be
: displayed as 100,500,300?

: I see in the help docs that the comma "," format symbol can be
: used. But how? Essentiall what I want to do is similar to pressing the
: button in MS Excel to convert a number from general to comma formatted.
: Thoughts?

: Here is what Help gave for info on it...

: Thanks,
: SM

: ********HELP*******

: , (comma) Thousands separator. If the format contains commas separated by #'s
: or 0's, the number is output with commas separating thousands. A comma
: following a placeholder scales the number by a thousand. For Example, the
: format 0, scales the number by 1000 (e.g., 10,000 would be converted as
: 10).

Sun Sep 16, 2001 4:41 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.