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
https://forums.phpfreaks.com/topic/237248-custom-counter/
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
https://forums.phpfreaks.com/topic/237248-custom-counter/#findComment-1219864
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.