Need help with Format Expression

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

Need help with Format Expression

Postby Eric Poker » Wed Nov 05, 2008 12:40 am

I want the hud to show 1K hands, 2K hands, etc. if players have more then 999 hands

I created Statistics "HandsK"
Definition - Value Expression :
Code: Select all
if(cnt_hands > 999, cnt_hands / 1000, cnt_hands)


Format - Format Expression :
Code: Select all
format_number(if(cnt_hands > 999, format('{1} K',cnt_hands / 1000),cnt_hands),1, true, false)


When the players has less then 999 hands, everything is fine but when the players had more then 999, the hud show 0
I think the mistake is with the {1} things because I succesfully showed 2 differents stats before (hands = 1285 ; hands2 = 1.3) but I'm probably doing something wrong when I try to display only the appropriate one


Thanks
Eric Poker
 
Posts: 104
Joined: Sat Mar 15, 2008 3:47 pm

Re: Need help with Format Expression

Postby kraada » Wed Nov 05, 2008 10:22 am

The stat you want is already in the Repository; search for "Hands played with k notation" and you'll find it. Then you can compare to what you've written and see what's different.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Need help with Format Expression

Postby Eric Poker » Thu Nov 06, 2008 1:29 am

Thank you
Eric Poker
 
Posts: 104
Joined: Sat Mar 15, 2008 3:47 pm


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

Who is online

Users browsing this forum: No registered users and 0 guests