I'm wanting to format numbers based on keypress / ng-change. After reading this post, I though I would be able to use some of the sample code to format my numbers with a fixed precision. The code works fine when called on page load and written out to the browser, it does not work when I apply the same code to the value of a text field on key press.
function GetChar (event){
var theValue = document.getElementById('foo').value;
document.write(theValue.format(2, 3, '.', '.'));
}