I would like the output for each function to yield $x.xx as if it were a price. Being new to javascript is there a simple way to accomplish this or is it a complex system to get the results that I desire for my project?
Below is the code i have made in javascript:
//First function outputs a random number
var myFirstFunction = function(First)
{
return First;
};
var FirstAnswer = myFirstFunction(Math.random());
console.log(FirstAnswer);
//Second function outputs the random number multiplied by 10
var mySecondFunction = function(Second)
{
return Second * 10;
};
var SecondAnswer = mySecondFunction(FirstAnswer);
console.log(SecondAnswer);
//Third function divided the random number by 3.3
var myThirdFunction = function(Third)
{
return Third / 3.3;
}
var ThirdAnswer = myThirdFunction(SecondAnswer);
console.log(ThirdAnswer)