Skip to content

Instantly share code, notes, and snippets.

Created September 24, 2008 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/12490 to your computer and use it in GitHub Desktop.
Save anonymous/12490 to your computer and use it in GitHub Desktop.
function print_cost() {
c = Math.floor(Number($cost_all) / 1000);
b = Number($cost_all) % 1000;
if (b == 0) {b = '000'}
//if (((b % 100) < 100)) {b = '0' + b}
$('.change_cost').text('from $' + c + ',' + b);
};
//$cost_all -- это стринг вида "3000" (тогда все хорошо) или "3678" (тогда косяк).
//выводить надо "from $3,000" или "from $3,678"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment