function getISOCurrency($curr) {
    $out = "";
    if(ctype_digit($curr) || is_int($curr)) {
      $numCurr = $curr + 0;
      if($numCurr < 10) {
        $out = "00" . $numCurr;
      } else if ($numCurr < 100) {
        $out = "0" . $numCurr;
      } else {
        //Assume 3 digits (if greater let MAPs handle error)
        $out = "" . $numCurr;
      }
    } else {
      // Convert char to digit
      $curCode = Array();
      $curCode["AUD"]="036";
      $curCode["CAD"]="124";
      $curCode["CHF"]="756";
      $curCode["CZK"]="203";
      $curCode["DKK"]="208";
      $curCode["EUR"]="978";
      $curCode["GBP"]="826";
      $curCode["HUF"]="348";
      $curCode["JPY"]="392";
      $curCode["NOK"]="578";
      $curCode["NZD"]="554";
      $curCode["PLN"]="985";
      $curCode["SEK"]="752";
      $curCode["SGD"]="702";
      $curCode["USD"]="840";
      $out = $curCode[$curr];
    }

    return $out;
  }