Jump to content

custom counter


samoht

Recommended Posts

Hello,

 

I am wondering how to create a counter that has 5 digits and counts the results from a db field (not just the returned results but the numeric SUM of the values in the field) for display.

 

i.e. if the sum of the field = 347 the counter would read 00347 

I have created images for the numbers 0-9 and named them 0.png, 1.png, 2.png etc

 

Also, I may have to sum a value that is stored in the db as serialized data (part of an array). If so how can I do that??

Link to comment
Share on other sites

OK,

 

I guess I could use some help with printf()

 

I get the concept but not sure how I figure out how many 0.png's I need to insert before the returned number value from the database?

 

Also I saw another webpage using a similar counter idea but there numbers came from a single image that had the numbers 0-9 on it. Do they use sprites to make the number they need??

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.