Grow your CSS skills. Land your dream job.

Increment counter formatting

  • # December 1, 2012 at 5:09 pm

    Basically the counter I have created for a website seems to be working as I want it to (I can edit it to do what I want) – but for some reason when I increment it by decimals i.e. 0.1, 0.2, 0.3 etc the formatting glitches?

    You can view the counter live at http://lowco2.eu

    Here is the code behind the counter:

    Script:

    >

    Any help is much appreciated!

    # December 5, 2012 at 6:58 am

    Can anyone help with this at all?

    Cheers

    # December 5, 2012 at 7:09 am

    I’m not seeing a counter on the link you provided.

    EDIT: Wow that’s hard to see.

    # December 5, 2012 at 7:14 am

    I don’t see the point behind having it on your website anyway as it’s not really a true reflection on the amount you’re exactly saving to be honest…

    But i just ran your code through [JSLint](http://www.jslint.com/ “”) on the JSFiddle website and it threw back a few errors.

    Try changing this;

    var number = < ?=(int)((time()-1262325600)/150);?>;

    To this;

    var number = (int)((time()-1262325600)/150);

    This is what I got – Here

    # December 6, 2012 at 5:40 pm

    > I’m not seeing a counter on the link you provided.

    EDIT: Wow that’s hard to see.

    It isn’t live hence it being hard to see, but thanks for your lack of help!

    Thanks Watson… I will give it a try and see if it begins to sort it out.

    It is possible to work out an estimate by taking the average tonnes of co2 they save over the last 3 years. I only design what they want though, so I won’t defend the need of it!

    Cheers

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".