Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Limit number of decimals on report fields?
Message
 
To
16/09/2008 13:27:14
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01347984
Message ID:
01347993
Views:
7
As an alternative you can use "Stretch with overflow" option. Otherwise the textbox width must be big enough to contain all the digits, and then you should know in advance how many to expect. Also, besides round() and transform() you may also try PADL().

>How can I limit the number of decimal places printed on the report for calculated fields?
>
>For instance, when I use JobItem.Qty*JobItem.Price on a report textbox, it wants to print many decimal places, but I only want 2 decimal places.
>
>When I use formatting like '999.99' I am always frustrated, because I do not know how big the number will be, so I have to guess how many digits to allow for on the left side of the decimal. I hate having to hard-code liek that. Maybe the result will require '999999.99', but if i make it that big it will print '******.**' on the report becuase the textbox is not big enough to hold all that.
>
>My point is that I want to contrain the number of digits on the RIGHT side of the decimal, but allow as many places to the LEFT of the decimal as required, without me having to tell it how many to allow for.
>
>Do that make sense?
>
>I have also experimented with TRANSFROM, but I still couldn't really get what I was after.
>
>Maybe I need a user function?
Previous
Reply
Map
View

Click here to load this message in the networking platform