How to print numbers with commas?

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

How to print numbers with commas?

Postby Patrick » Wed Nov 02, 2011 9:55 pm

Wondering how everyone else prints numbers above 999 - do you add a comma as a seperator? IE 1,000

I use the vpe.Write command to print numbers now - My development language (Lansa) has an option to print the numeric field as a string:

IE
Invoke Method(#VPE.Write) Left(1) Top(1) Right(9) Bottom(2) Text('Total Enrollment Count: ' + #TOTSTU.AsString')

(#TOTSTU is a signed/numeric field and no decimals)

but this way does not use the edit code for the number (the edit code adds the commas). How can I print numbers with commas?

Is there a VPE command to write a number instead of text? I sure cannot find it in the documentation or in this forum.

I really don't want to write a subroutine to add commas!? :shock:

Thank you,
Pat
(U.S.)
Patrick
 
Posts: 23
Joined: Thu Mar 12, 2009 5:44 pm

Re: How to print numbers with commas?

Postby IDEAL Software Support » Thu Nov 03, 2011 5:59 am

If your programming language is not capable of formatting numbers as strings, then you have to write your own code.

The text-output API of VPE does only accept strings, except the Enterprise Edition where you can define forms using our visual designer dycodoc. Within such forms you can use fields (i.e. variables) and you may specify formatting parameters for such variables.
IDEAL Software Support
 
Posts: 1631
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 17 guests

cron