當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Manager::currency方法代碼示例

本文整理匯總了PHP中Manager::currency方法的典型用法代碼示例。如果您正苦於以下問題:PHP Manager::currency方法的具體用法?PHP Manager::currency怎麽用?PHP Manager::currency使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Manager的用法示例。


在下文中一共展示了Manager::currency方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: currency

 public function currency()
 {
     $value = 123456.78;
     $this->data->value = 'Valor = ' . $value;
     $currency = Manager::currency($value);
     $this->data->currency = 'Currency = ' . $currency;
     $formated = $currency->format();
     $this->data->formated = 'Formatado = ' . $formated;
     $currency = Manager::currency($formated);
     $value = $currency->getValue();
     $this->data->getValue = 'Get Value = ' . $value;
     $currency->setValue(87654321.09);
     $this->data->setValue = 'Após setValue = ' . $currency;
     $currency->setValue(-654.3200000000001);
     $this->data->setValueNeg = 'Após setValue negativo = ' . $currency;
     $currency = Manager::currency('-R$ 123.345,67');
     $value = $currency->getValue();
     $this->data->valueNeg = 'Valor negativo = ' . $value;
     $valor1 = Manager::currency(10.9008900015);
     $valor2 = Manager::currency(10.9008900017);
     mdump($valor1->getValue() == $valor2->getValue() ? 'Valores iguais' : 'Valores diferentes');
     $valor1 = Manager::currency(10.9018900015);
     $valor2 = Manager::currency(10.9068900017);
     mdump($valor1->getValue() == $valor2->getValue() ? 'Valores iguais' : 'Valores diferentes');
     $this->render();
 }
開發者ID:joshuacoddingyou,項目名稱:php,代碼行數:26,代碼來源:typesController.php

示例2: renderCurrencyValue

 public function renderCurrencyValue($value)
 {
     if (is_numeric($value)) {
         $v = Manager::currency((double) $value);
         $value = $v->formatValue();
     }
     return new MLabel($value);
 }
開發者ID:joshuacoddingyou,項目名稱:php,代碼行數:8,代碼來源:mgridcolumnrender.php

示例3: convertToPHPValue

 public function convertToPHPValue($value, $type)
 {
     if ($type == 'date') {
         return \Manager::Date($value);
     } elseif ($type == 'timestamp') {
         return \Manager::Timestamp($value);
     } elseif ($type == 'currency') {
         return \Manager::currency($value);
     } elseif ($type == 'cnpj') {
         return \MCNPJ::create($value);
     } elseif ($type == 'cpf') {
         return \MCPF::create($value);
     } elseif ($type == 'blob') {
         if ($value) {
             $value = base64_decode($value);
         }
         $value = \MFile::file($value);
         return $value;
     } else {
         return $value;
     }
 }
開發者ID:joshuacoddingyou,項目名稱:php,代碼行數:22,代碼來源:platform.php

示例4: formTextField

 public function formTextField()
 {
     $this->data->email = 'a@teste.com';
     $this->data->nomeValidator = false;
     $this->data->currency = Manager::currency(1234.56);
     $this->data->dataNascimento = Manager::date(Manager::getSysDate());
     $this->data->timestamp = Manager::timestamp(Manager::getSysTime());
     $this->render();
 }
開發者ID:joshuacoddingyou,項目名稱:php,代碼行數:9,代碼來源:controlsController.php


注:本文中的Manager::currency方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。