Tom Muck

Alpha Dog Blues Band
Home page
All articles
All Extensions | Extension News | Extension FAQs | Customer Login
Books authored or co-authored by Tom Muck
Extensions, books, and other products | Customer Login
Your current cart contents
Tom-Muck.com Blog | CMXTraneous Blog | Flash Remoting Blog
About the site

Locale Issues

Locale Workaround

This workaround is for people who cannot for one reason or another find out their server locale information. If all else fails, you can hard-code the money formatting function in CWIncFunctions.php:

// Format for the money for CW2
function cartweaverMoney($theNum) {
  return "$" . number_format($theNum, 2, ".",",");
}

// for CW3
function cartweaverMoney($theNum, $showCurrencySymbol = true, $stripComma = false) {
  $currencySymbol = '$';
  $theNum = number_format($theNum, 2, ".",",");
  if($showCurrencySymbol) $theNum = $currencySymbol . $theNum;
  if($stripComma) $theNum = str_replace(",","",$theNum);
  return $theNum;
}

Back to Cartweaver PHP FAQ, code changes, and samples

Pay me securely with your Visa, MasterCard, Discover, or American Express card through PayPal!
Pay me securely with your Visa, MasterCard, Discover, or American Express card through PayPal!
About | Privacy Policy | Contact | License Agreement | ©2002-2026 Tom Muck | Dreamweaver Extensions