Math objects

Number 1
Number 1 rounded to 6 decimal places
Number 2
Number 2 in hexadecimal

A copy of the JavaScript functions:

// sample-9-number-objects.js
// This sample shows some Number objects

// display the input date in several formats
function display()
  {
  var output1a = document.getElementById("output1a");
  var output1b = document.getElementById("output1b");
  var output2a = document.getElementById("output2a");
  var output2b = document.getElementById("output2b");
  // Number objects
  my_number_object_1 = new Number(Math.PI);
  my_number_object_2 = new Number(255);
  // output1a and output2a cause the toString method to execute with no parameters
  output1a.value = my_number_object_1;
  output1b.value = my_number_object_1.toFixed(6);
  output2a.value = my_number_object_2;
  output2b.value = my_number_object_2.toString(16);
  }