View Single Post
06-18-10, 10:17 PM   #2
Waverian
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 188
Originally Posted by alimjocox View Post
Code:
bar.value:SetFormattedText("|cff%02x%02x%02x%d%%|r (%s)", r*255, g*255, b*255, (min-max), ShortValue(max))
So I'm using oUF and trying to edit a PostUpdateHealth function. for some reason. If i get rid of the % it falls apart.. but if i leave it there it looks like this..



I'm trying to get rid of the % sign.. help?
% is used to precede a formatting token. For example %02x in your string is a single token that formats an integer value to hex. If you want your formatted string to have a % sign in the string itself, you need to escape it with an extra % sign. That means to get the % sign to display you need to have %% in your formatting string.

Which means to get rid of it, remove the two side-by-side % signs, not just one.
  Reply With Quote