// Copyright 2000-2008, Newsfutures, Inc. All Rights Reserved. // Confidential and Proprietary Information of Newsfutures, Inc. function cents (cents) { document.write(toCents(cents)); } function toCents (cents) { return (Math.abs(cents) > 99) ? toDollars(cents) : (cents + '¢'); } function dollars (cents) { document.write(toDollars(cents)); } function toDollars (cents) { var isNeg = (cents < 0); if (isNeg) { cents = -1*cents; } var f = cents % 100; var decimal = (f < 10) ? ('0' + f) : f; return ((isNeg ? '-' : '') + Math.floor(cents/100) + ',' + decimal + ' €'); }