Within this lesson, we are going to be finishing off our tip calculating project, let's add in a new
variable.
I'm going to call it temp B, essentially our template for our output.
I'm using single quotes within this one because in case I want to use double quotes within my HTML,
I want to fine tune it.
So and I'm also going to update the output to be inner HTML as well so we can write.
You should tip and then have a dollar sign value there and then we can break out of the string.
So this would be whatever our tip value is and then break back into the string with a single code on.
And then this is the total number of or total cost that we're calculating that tip upon.
So close that off.
We need to create those variables.
So Tip will contain a value of what we were outputting in the console and we want to update this and
fix it.
So we're going to use two fixed.
And essentially what this does is at format's the number to a fixed point notation and with currency
numbers, we want to account for sense.
So we want to move in two decimal places over to account for the sense.
So that's going to give us a value for the tip.
And then we already have that value for the cost as well.
So let's save that and refresh and let's do TYP and then we need to still update this to our HTML and
the HTML here is going to be whatever the value of Tempest's.
So refresh typ and we get an output of you should tip 15 dollars on object because we don't have the
value there.
So make sure that we add in value there.
Try that one more time.
You should tip 15 dollars on one type of format.
We can calculate whatever the tip is going to be.
So even if this has since attached to it, you're going to see that it outputs here within that sense
format as well.
And we get the tip being calculated on the total value.
That's input within that input field.
In the upcoming lesson, I'll show you how you comtemplate this.
And this is going to make your code a little bit neater as well.
So templating what that does is it allows you to bring the object in without having these breaks out
of the string value.
So that's coming up in the next lesson.
So go ahead and try this out and make sure that your tip calculator is functioning.