<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Number-Formatting Test</title>
<script type="text/javascript" src="number-functions.js"></script>
</head>
<body>
<script type="text/javascript">
function doit(form) {
form.elements["dest"].value = new Number(form.elements["src"].value).numberFormat(form.elements["format"].value);
form.elements["text"].value = Number.prototype[Number.formatFunctions[form.elements["format"].value]];
}
</script>
<h1>Number-Formatting Demo</h1>
<p>Use the form below to experiment with the number-formatting functionality.
You can enter a value and a format string, and then click the button to see the
results. The code that's generated to handle the formatting will be
displayed in the text area.</p>
<form method="get" action="">
<table>
<tr><td><label for="src">value</label></td><td><input id="src" type="text" name="src" /></td></tr>
<tr><td><label for="format">format</label></td><td><input id="format" type="text" name="format" /></td></tr>
<tr><td><label for="dest">result</label></td><td><input id="dest" type="text" name="dest" /></td></tr>
<tr><td><input type="button" onClick="doit(this.form)" value="do it!" /></td><td></td></tr>
</table>
<textarea name="text" rows="10" style="width:100%"></textarea>
</form>
</body>
</html>