Rounding

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Rounding

Postby makodim » Sun Apr 17, 2011 6:14 pm

hi, me use format_money in Format Expression, how me can value format_money To approximate to an integer ? ( now XXX.xx, need XXX )
makodim
 
Posts: 136
Joined: Tue Jun 03, 2008 11:46 am

Re: Rounding

Postby WhiteRider » Mon Apr 18, 2011 3:38 am

You can't do that with format_money, but you can get whole numbers using either:

/%.0f

..or..

format_number( value, 0, false, true )

The first is just a plain number format to 0 decimal places, the second formats "value" to 0 decimal places, without commas for thousands separators, coloured red or green for negative or positive). If you click "insert" in a stat and look at the Functions tab you can see the format of the expression.
See also the Tutorial: Custom Reports and Statistics for more information on formatting stats.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 0 guests