コード例 #1
0
ファイル: test-numbers-words.php プロジェクト: decimerulo/ERP
</i></nobr></td>
        <td><b><?php 
            echo $ret;
            ?>
</b></td>
      </tr><?php 
        } else {
            echo sprintf("%30s: '", $loc_name . ' (' . $loc_symbol . ')') . $ret . "'\n";
        }
    }
}
reset($langs);
$num .= '.34';
$handle = new Numbers_Words();
while (list($loc_symbol, $loc_name) = each($langs)) {
    $ret = $handle->toCurrency($num, $loc_symbol);
    if (PEAR::isError($ret)) {
        if ($html_on) {
        }
        echo "Error ({$loc_symbol}): " . $ret->message . "\n";
        if ($html_on) {
        }
    } else {
        if ($html_on) {
            ?>
      <tr>
        <td align="center"><?php 
            echo $loc_symbol;
            ?>
</td>
        <td><nobr><i><?php 
コード例 #2
0
 /**
  * @expectedException Numbers_Words_Exception
  * @expectedExceptionMessage Unable to include the Numbers/Words/lang.doesnotexist.php file
  */
 function testToCurrencyInvalidLocale()
 {
     $nw = new Numbers_Words();
     $nw->toCurrency(1, 'doesnotexist');
 }
コード例 #3
0
 public function actionConvert()
 {
     include "Numbers/Words.php";
     $nw = new Numbers_Words();
     echo ucwords($nw->toCurrency($_POST['Property']['total_price'], 'en_GB'));
 }
コード例 #4
0
            echo "select error";
            exit;
        } else {
            while ($row = $q->fetchRow()) {
                foreach ($row as $key => $val) {
                    ${$key} = $val;
                    $render .= $key . "->" . $val . "<br>";
                }
            }
        }
        if (!$off_conditions) {
            $off_conditions = 'None';
        }
        $nw = new Numbers_Words();
        #$off_price_word = $nw->toWords(numbers_only(format_price($off_price)),'en_GB');
        $off_price_word = $nw->toCurrency($off_price, 'en_GB', 'GBP');
        $offer_text = str_replace("  ", " ", $vendor_name . '
' . $vendor_addr1 . ' ' . $vendor_addr2 . ' ' . $vendor_addr3 . '
' . $vendor_addr5 . '
' . $vendor_postcode . '

' . date('l jS F Y') . '

Dear ' . $vendor_name . ',

Re: ' . $pro_addr . '

Further to our recent conversation, we write to confirm the following offer made on the above property: -

Offer made by:   ' . preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $cli_name) . '
Date of offer:   ' . $date . '