## Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

### Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

# How do you get the seconds alive integer to be displayed with the appropriate commas?

I completed the task and got the answer to how many seconds I've been alive, but it displays it as an integer without commas. How can I get it to display commas?

Hey Russel, this is what I did:

var secondsPerMin = 60;

var minsPerHour = 60;

var hoursPerDay = 24;

var daysPerWeek = 7;

var weeksPerYear= 52;

var secondsPerDay = secondsPerMin * minsPerHour * hoursPerDay;

document.write("<h3>There are " + secondsPerDay.toLocaleString() + " seconds in a day.</h3>");

var yearsAlive= 34;

var secondsAlive = secondsPerDay * daysPerWeek * weeksPerYear * yearsAlive;

document.write("<br><h2>You have been alive for more than " + secondsAlive.toLocaleString() + " seconds.</h2>");

Same here! hahaha! It worked! Thanx!

Can I see how you used that with document.write? I don't understand.

Russell, I'm pretty new to this myself but I did a bit of research because I was curious as well. It seems you first have to define a new variable that calculates the total seconds in a day. You can't just use the mathematics along with the .toLocaleString() command (I may be incorrect here).

```var secondsPerDay = secondsPerMin * minPerHour * HourPerDay;
```var message = 'There are ' + secondsPerDay.toLocaleString() + ' seconds in a day';
```document.write(message);