coding problem at custom stat

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

coding problem at custom stat

Postby cizzo » Fri Apr 19, 2013 8:18 am

this is a custom stat which shows me the PFR from the SB in a husng.

format( '{1}% ({2}/{3})', format_number((cnt_pfr_sb / cnt_hands_sb) * 100 ,0,false,false), cnt_pfr_sb, cnt_hands_sb )

the problem is that it always shows me a "%" as a suffix and the opportunities and i can't turn it off as it is already in the configure hud menu. i think i have to change something in this code but i have no clue what.
cizzo
 
Posts: 36
Joined: Sat Feb 18, 2012 6:33 pm

Re: coding problem at custom stat

Postby kraada » Fri Apr 19, 2013 10:58 am

You don't want to use that format expression at all then - you want to set the value expression to:

(cnt_pfr_sb / cnt_hands_sb) * 100

and set the format expression to %.2f and then everything will work like you want. That format expression hard codes in the % and the times/opportunities.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: coding problem at custom stat

Postby cizzo » Fri Apr 19, 2013 4:03 pm

also at this stat, the color ranges doesn't appear in the hud. is there something wrong with it in the coding ? i set one range to 60-69 and the other one to 70-100 but the color ranges doesn't appear. it's only at this stat in my hud...

so far, thank you kraada ;)
cizzo
 
Posts: 36
Joined: Sat Feb 18, 2012 6:33 pm

Re: coding problem at custom stat

Postby kraada » Sat Apr 20, 2013 8:00 am

Were you doing the color range in the HUD or in the stat itself?
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


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

Who is online

Users browsing this forum: No registered users and 13 guests

cron
highfalutin