Hands k stat in HUD for less than 1000 hands

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

Hands k stat in HUD for less than 1000 hands

Postby rowhousepd » Sun Sep 20, 2009 8:21 pm

I'd like to tweak the Hand k stat I use for the HUD that I downloaded from the repository. Right now, it displays the stats as a whole number and one one digit after the decimal, but it only does it for over 1000 hands. When the number is anything less than 1000 is shown as a full three digit number. So for example, right now 321 hands displays as "321" (rather than "0.3" which is what I assumed would be the case). It gets a bit confusing when I multitable, quick glance at the stat in the HUD, and think for a second that the villain has played 321,000 hands. Basically I just want it to be consistent.

I've been playing around with the Format Expression in the Configure Statistic screen, but I can't seem to get it to work. Right now it reads:

if( cnt_hands>999 , format( '{1}k' , format_number((cnt_hands / 1000) , 1 , false , false)) , cnt_hands )

What should I change to get what I'm looking for?
rowhousepd
 
Posts: 329
Joined: Sun Mar 22, 2009 4:00 am
Location: Philadelphia, PA

Re: Hands k stat in HUD for less than 1000 hands

Postby WhiteRider » Mon Sep 21, 2009 4:53 am

The bit you need to change is the last bit "cnt_hands".

Actually, If you always want it to read "x.yk" (0.3k in your example) then you could replace the whole expression with:
format_number((cnt_hands / 1000) , 1 , false , false)

If you want things to look at all different for less than 1000 hands then you can replace the cnt_hands at the end with another format expression.
if( cnt_hands>999 , format( '{1}k' , format_number((cnt_hands / 1000) , 1 , false , false)) , cnt_hands )
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Hands k stat w/ Color Ranges

Postby rowhousepd » Tue Sep 22, 2009 4:18 pm

Great, got it, thanks. But now for part two: colors....

I'd like to create simple color ranges when configuring this stat so that it will show up differently on the HUD depending on what the value is. I know I can create color ranges in the HUD profile settings, but since we can't save a group configuration and use it across different HUD profiles, I want to have the color coding embedded within the stats so it will always show up the same way by default no matter what profile I'm using.

For example, let's say I want to have it display in green for hands between 0 and 500, orange for 501-1000, and red for 1001+. I thought you'd simply enter a different condition for each range. So in the Color Expression window it would be something like this:
#Hands# <= 500 (I'd select green)
#Hands# >= 501 and #Hands# <= 1000 (I'd select orange)
#Hands# >= 1000 (I'd select red, etc...)

Well, this isn't working so I guess I'm not clear about how to make valid expressions for conditions like. Can you help?

p.s. Are there any plans to make customized groups in a HUD profile savable ... & thus importable to another profile? Thanks.
rowhousepd
 
Posts: 329
Joined: Sun Mar 22, 2009 4:00 am
Location: Philadelphia, PA

Re: Hands k stat in HUD for less than 1000 hands

Postby kraada » Tue Sep 22, 2009 4:48 pm

Try using the cnt_hands column instead of the #Hands# statistic, that might work better.
kraada
Moderator
 
Posts: 54430
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 0 guests