• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP unformat_number函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中unformat_number函数的典型用法代码示例。如果您正苦于以下问题:PHP unformat_number函数的具体用法?PHP unformat_number怎么用?PHP unformat_number使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了unformat_number函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: unformatField

 public function unformatField($formattedField, $vardef)
 {
     if ($formattedField === '' || $formattedField === NULL) {
         return null;
     }
     return (double) unformat_number($formattedField);
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:7,代码来源:SugarFieldFloat.php


示例2: unformatField

 public function unformatField($formattedField, $vardef)
 {
     if ($formattedField === '' || $formattedField === NULL) {
         return '';
     }
     return (int) unformat_number($formattedField);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:7,代码来源:SugarFieldInt.php


示例3: saveListItems

 function saveListItems()
 {
     require_once 'modules/AOS_Products_Quotes/AOS_Products_Quotes.php';
     $productQuote = new AOS_Products_Quotes();
     $product = array('id' => $_POST['product_quote_id'], 'product_id' => $_POST['product_id'], 'product_name' => $_POST['product_name'], 'product_qty' => $_POST['product_qty'], 'vat' => $_POST['vat'], 'vat_amt' => $_POST['vat_amt'], 'product_list_price' => $_POST['product_list_price'], 'product_unit_price' => $_POST['product_unit_price'], 'product_total_price' => $_POST['product_total_price'], 'product_note' => $_POST['product_note'], 'deleted' => $_POST['deleted']);
     $productLineCount = count($product['product_id']);
     for ($i = 0; $i < $productLineCount; $i++) {
         $productQuote->id = $product['id'][$i];
         $productQuote->parent_id = $this->id;
         $productQuote->parent_type = 'AOS_Invoices';
         $productQuote->product_id = $product['product_id'][$i];
         $productQuote->name = $product['product_name'][$i];
         $productQuote->product_qty = $product['product_qty'][$i];
         $productQuote->product_list_price = unformat_number($product['product_list_price'][$i]);
         $productQuote->product_unit_price = unformat_number($product['product_unit_price'][$i]);
         $productQuote->vat = $product['vat'][$i];
         $productQuote->vat_amt = unformat_number($product['vat_amt'][$i]);
         $productQuote->product_total_price = unformat_number($product['product_total_price'][$i]);
         $productQuote->description = $product['product_note'][$i];
         $productQuote->deleted = $product['deleted'][$i];
         if ($productQuote->deleted == 1) {
             $productQuote->mark_deleted($productQuote->id);
         } else {
             if (trim($productQuote->product_id) != '') {
                 $productQuote->save();
             }
         }
     }
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:29,代码来源:AOS_Invoices.php


示例4: ReadData

 function ReadData($targetstring, &$map, &$item)
 {
     $data[IN] = NULL;
     $data[OUT] = NULL;
     $data_time = 0;
     $itemname = $item->name;
     $matches = 0;
     $fd = fopen($targetstring, "r");
     if ($fd) {
         while (!feof($fd)) {
             $buffer = fgets($fd, 4096);
             # strip out any Windows line-endings that have gotten in here
             $buffer = str_replace("\r", "", $buffer);
             if (preg_match("/^{$itemname}\t(\\d+\\.?\\d*[KMGT]*)\t(\\d+\\.?\\d*[KMGT]*)/", $buffer, $matches)) {
                 $data[IN] = unformat_number($matches[1]);
                 $data[OUT] = unformat_number($matches[2]);
             }
         }
         $stats = stat($targetstring);
         $data_time = $stats['mtime'];
     } else {
         // some error code to go in here
         debug("TabText ReadData: Couldn't open ({$targetstring}). \n");
     }
     debug("TabText ReadData: Returning (" . ($data[IN] === NULL ? 'NULL' : $data[IN]) . "," . ($data[OUT] === NULL ? 'NULL' : $data[OUT]) . ",{$data_time})\n");
     return array($data[IN], $data[OUT], $data_time);
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:27,代码来源:WeatherMapDataSource_tabfile.php


示例5: perform_save

function perform_save(&$focus)
{
    //US DOLLAR
    if (isset($focus->amount) && !number_empty($focus->amount)) {
        $currency = new Currency();
        $currency->retrieve($focus->currency_id);
        $focus->amount_usdollar = $currency->convertToDollar(unformat_number($focus->amount));
    }
}
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:9,代码来源:SaveOverload.php


示例6: perform_save

function perform_save(&$focus)
{
    require_once 'modules/Currencies/Currency.php';
    //US DOLLAR
    if (isset($focus->price) && !number_empty($focus->price)) {
        $currency = new Currency();
        $currency->retrieve($focus->currency_id);
        $focus->price_usdollar = $currency->convertToDollar(unformat_number($focus->price));
    }
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:10,代码来源:SaveOverload.php


示例7: unformatField

 public function unformatField($formattedField, $vardef)
 {
     if ($formattedField === '' || $formattedField === NULL) {
         return '';
     }
     if (is_array($formattedField)) {
         $formattedField = array_shift($formattedField);
     }
     return (double) unformat_number($formattedField);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:10,代码来源:SugarFieldFloat.php


示例8: save

 function save($df)
 {
     //the currency field
     $this->default = unformat_number($this->default);
     $this->default_value = $this->default;
     parent::save($df);
     //currency id
     $currency_id = new TemplateCurrencyId();
     $currency_id->name = 'currency_id';
     $currency_id->vname = 'LBL_CURRENCY';
     $currency_id->label = $currency_id->vname;
     $currency_id->save($df);
     //$df->addLabel($currency_id->vname);
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:14,代码来源:TemplateCurrency.php


示例9: perform_aos_save

/**
 * Products, Quotations & Invoices modules.
 * Extensions to SugarCRM
 * @package Advanced OpenSales for SugarCRM
 * @subpackage Products
 * @copyright SalesAgility Ltd http://www.salesagility.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
 * along with this program; if not, see http://www.gnu.org/licenses
 * or write to the Free Software Foundation,Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301  USA
 *
 * @author Salesagility Ltd <[email protected]>
 */
function perform_aos_save($focus)
{
    foreach ($focus->field_defs as $field) {
        $fieldName = $field['name'];
        $fieldNameDollar = $field['name'] . '_usdollar';
        if (isset($focus->field_defs[$fieldNameDollar])) {
            $focus->{$fieldNameDollar} = '';
            if (!number_empty($focus->field_defs[$field['name']])) {
                $currency = new Currency();
                $currency->retrieve($focus->currency_id);
                $focus->{$fieldNameDollar} = $currency->convertToDollar(unformat_number($fieldName));
            }
        }
    }
}
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:39,代码来源:AOS_Utils.php


示例10: testUnformatNumber

 public function testUnformatNumber()
 {
     global $current_user;
     $testValue = "\$100,000.50";
     $unformattedValue = unformat_number($testValue);
     $this->assertEquals($unformattedValue, 100000.5, "Assert that \$100,000.50 becomes 100000.50. Formatted value is: " . $unformattedValue);
     //Switch the num_grp_sep and dec_sep values
     $current_user->setPreference('num_grp_sep', '.');
     $current_user->setPreference('dec_sep', ',');
     $current_user->save();
     //Force reset on dec_sep and num_grp_sep because the dec_sep and num_grp_sep values are stored as static variables
     get_number_seperators(true);
     $testValue = "\$100.000,50";
     $unformattedValue = unformat_number($testValue);
     $this->assertEquals($unformattedValue, 100000.5, "Assert that \$100.000,50 becomes 100000.50. Formatted value is: " . $unformattedValue);
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:16,代码来源:CurrencyTest.php


示例11: save

 public function save($df)
 {
     //the currency field
     $this->default = unformat_number($this->default);
     $this->default_value = $this->default;
     $this->related_fields = array('currency_id', 'base_rate');
     parent::save($df);
     $df->addLabel('LBL_CURRENCY');
     //currency id
     $currency_id = new TemplateCurrencyId();
     $currency_id->name = 'currency_id';
     $currency_id->save($df);
     //base_rate
     $base_rate = new TemplateCurrencyBaseRate();
     $base_rate->name = 'base_rate';
     $base_rate->label = 'LBL_CURRENCY_RATE';
     $base_rate->save($df);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:18,代码来源:TemplateCurrency.php


示例12: ReadData

 function ReadData($targetstring, &$map, &$item)
 {
     $inbw = NULL;
     $outbw = NULL;
     $data_time = 0;
     if (preg_match("/^static:(\\-?\\d+\\.?\\d*[KMGT]*):(\\-?\\d+\\.?\\d*[KMGT]*)\$/", $targetstring, $matches)) {
         $inbw = unformat_number($matches[1], $map->kilo);
         $outbw = unformat_number($matches[2], $map->kilo);
         $data_time = time();
     }
     if (preg_match("/^static:(\\-?\\d+\\.?\\d*[KMGT]*)\$/", $targetstring, $matches)) {
         $inbw = unformat_number($matches[1], $map->kilo);
         $outbw = $inbw;
         $data_time = time();
     }
     wm_debug("Static ReadData: Returning ({$inbw},{$outbw},{$data_time})\n");
     return array($inbw, $outbw, $data_time);
 }
开发者ID:stapler2025,项目名称:Weathermap-librenms,代码行数:18,代码来源:WeatherMapDataSource_static.php


示例13: SaveQuery

 /**
  * SaveQuery
  *  
  * This function handles saving the query parameters to the user preferences
  * SavedSearch.php does something very similar when saving saved searches as well
  * 
  * @see SavedSearch
  * @param $name String name  to identify this query
  */
 function SaveQuery($name)
 {
     global $current_user, $timedate;
     if (isset($this->query['module'])) {
         $bean = loadBean($this->query['module']);
         if (!empty($bean)) {
             foreach ($this->query as $key => $value) {
                 //Filter date fields to ensure it is saved to DB format, but also avoid empty values
                 if (!empty($value) && preg_match('/^(start_range_|end_range_|range_)?(.*?)(_advanced|_basic)$/', $key, $match)) {
                     $field = $match[2];
                     if (isset($bean->field_defs[$field]['type']) && empty($bean->field_defs[$field]['disable_num_format'])) {
                         $type = $bean->field_defs[$field]['type'];
                         if (($type == 'date' || $type == 'datetime' || $type == 'datetimecombo') && !preg_match('/^\\[.*?\\]$/', $value)) {
                             $db_format = $timedate->to_db_date($value, false);
                             $this->query[$key] = $db_format;
                         } else {
                             if ($type == 'int' || $type == 'currency' || $type == 'decimal' || $type == 'float') {
                                 if (preg_match('/[^\\d]/', $value)) {
                                     require_once 'modules/Currencies/Currency.php';
                                     $this->query[$key] = unformat_number($value);
                                     //Flag this value as having been unformatted
                                     $this->query[$key . '_unformatted_number'] = true;
                                     //If the type is of currency and there was a currency symbol (non-digit), save the symbol
                                     if ($type == 'currency' && preg_match('/^([^\\d])/', $value, $match)) {
                                         $this->query[$key . '_currency_symbol'] = $match[1];
                                     }
                                 } else {
                                     //unset any flags
                                     if (isset($this->query[$key . '_unformatted_number'])) {
                                         unset($this->query[$key . '_unformatted_number']);
                                     }
                                     if (isset($this->query[$key . '_currency_symbol'])) {
                                         unset($this->query[$key . '_currency_symbol']);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     $current_user->setPreference($name . 'Q', $this->query);
 }
开发者ID:nartnik,项目名称:sugarcrm_test,代码行数:53,代码来源:StoreQuery.php


示例14: handleAdd

 function handleAdd()
 {
     global $current_user;
     if ($current_user->is_admin) {
         if (isset($_POST['edit']) && $_POST['edit'] == 'true' && isset($_POST['name']) && !empty($_POST['name']) && isset($_POST['conversion_rate']) && !empty($_POST['conversion_rate']) && isset($_POST['symbol']) && !empty($_POST['symbol'])) {
             $currency = new Currency();
             if (isset($_POST['record']) && !empty($_POST['record'])) {
                 $currency->retrieve($_POST['record']);
             }
             $currency->name = $_POST['name'];
             $currency->status = $_POST['status'];
             $currency->symbol = $_POST['symbol'];
             $currency->iso4217 = $_POST['iso4217'];
             $currency->conversion_rate = unformat_number($_POST['conversion_rate']);
             $currency->save();
             $this->focus = $currency;
         }
     }
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:19,代码来源:ListCurrency.php


示例15: handleAdd

 /**
  * handle creating or updating a currency record
  *
  */
 function handleAdd()
 {
     global $current_user;
     if ($current_user->is_admin) {
         if (isset($_POST['edit']) && $_POST['edit'] == 'true' && isset($_POST['name']) && !empty($_POST['name']) && isset($_POST['conversion_rate']) && !empty($_POST['conversion_rate']) && isset($_POST['symbol']) && !empty($_POST['symbol'])) {
             $currency = BeanFactory::getBean('Currencies');
             $isUpdate = false;
             if (isset($_POST['record']) && !empty($_POST['record'])) {
                 $isUpdate = true;
                 $currency->retrieve($_POST['record']);
             }
             $currency->name = $_POST['name'];
             $currency->status = $_POST['status'];
             $currency->symbol = $_POST['symbol'];
             $currency->iso4217 = $_POST['iso4217'];
             $previousConversionRate = $currency->conversion_rate;
             $currency->conversion_rate = (string) unformat_number($_POST['conversion_rate']);
             $currency->save();
             $this->focus = $currency;
             // Used to tell calling code that a change was made
             $this->recordSaved = true;
             //Check if the conversion rates changed and, if so, update the rates with a scheduler job
             if ($isUpdate && $previousConversionRate != $currency->conversion_rate) {
                 global $timedate;
                 // use bean factory here
                 $job = BeanFactory::getBean('SchedulersJobs');
                 $job->name = "SugarJobUpdateCurrencyRates: " . $timedate->getNow()->asDb();
                 $job->target = "class::SugarJobUpdateCurrencyRates";
                 $job->data = $currency->id;
                 $job->retry_count = 0;
                 $job->assigned_user_id = $current_user->id;
                 $jobQueue = new SugarJobQueue();
                 $jobQueue->submitJob($job);
             }
         }
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:41,代码来源:ListCurrency.php


示例16: fixUpFormatting

 /**
  * Function corrects any bad formatting done by 3rd party/custom code
  *
  * This function will be removed in a future release, it is only here to assist upgrading existing code that expects formatted data in the bean
  */
 function fixUpFormatting()
 {
     global $timedate;
     static $boolean_false_values = array('off', 'false', '0', 'no');
     foreach ($this->field_defs as $field => $def) {
         if (!isset($this->{$field})) {
             continue;
         }
         if (isset($def['source']) && $def['source'] == 'non-db' || $field == 'deleted') {
             continue;
         }
         if (isset($this->fetched_row[$field]) && $this->{$field} == $this->fetched_row[$field]) {
             // Don't hand out warnings because the field was untouched between retrieval and saving, most database drivers hand pretty much everything back as strings.
             continue;
         }
         $reformatted = false;
         switch ($def['type']) {
             case 'datetime':
             case 'datetimecombo':
                 if (empty($this->{$field})) {
                     break;
                 }
                 if ($this->{$field} == 'NULL') {
                     $this->{$field} = '';
                     break;
                 }
                 if (!preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$/', $this->{$field})) {
                     // This appears to be formatted in user date/time
                     $this->{$field} = $timedate->to_db($this->{$field});
                     $reformatted = true;
                 }
                 break;
             case 'date':
                 if (empty($this->{$field})) {
                     break;
                 }
                 if ($this->{$field} == 'NULL') {
                     $this->{$field} = '';
                     break;
                 }
                 if (!preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $this->{$field})) {
                     // This date appears to be formatted in the user's format
                     $this->{$field} = $timedate->to_db_date($this->{$field}, false);
                     $reformatted = true;
                 }
                 break;
             case 'time':
                 if (empty($this->{$field})) {
                     break;
                 }
                 if ($this->{$field} == 'NULL') {
                     $this->{$field} = '';
                     break;
                 }
                 if (preg_match('/(am|pm)/i', $this->{$field})) {
                     // This time appears to be formatted in the user's format
                     $this->{$field} = $timedate->fromUserTime($this->{$field})->format(TimeDate::DB_TIME_FORMAT);
                     $reformatted = true;
                 }
                 break;
             case 'double':
             case 'decimal':
             case 'currency':
             case 'float':
                 if ($this->{$field} === '' || $this->{$field} == NULL || $this->{$field} == 'NULL') {
                     continue;
                 }
                 if (is_string($this->{$field})) {
                     $this->{$field} = (double) unformat_number($this->{$field});
                     $reformatted = true;
                 }
                 break;
             case 'uint':
             case 'ulong':
             case 'long':
             case 'short':
             case 'tinyint':
             case 'int':
                 if ($this->{$field} === '' || $this->{$field} == NULL || $this->{$field} == 'NULL') {
                     continue;
                 }
                 if (is_string($this->{$field})) {
                     $this->{$field} = (int) unformat_number($this->{$field});
                     $reformatted = true;
                 }
                 break;
             case 'bool':
                 if (empty($this->{$field})) {
                     $this->{$field} = false;
                 } else {
                     if (true === $this->{$field} || 1 == $this->{$field}) {
                         $this->{$field} = true;
                     } else {
                         if (in_array(strval($this->{$field}), $boolean_false_values)) {
                             $this->{$field} = false;
//.........这里部分代码省略.........
开发者ID:rgauss,项目名称:sugarcrm_dev,代码行数:101,代码来源:SugarBean.php


示例17: display

 /**
  * @see SugarView::display()
  */
 public function display()
 {
     if (!empty($_REQUEST['handle']) && $_REQUEST['handle'] == 'save') {
         return $this->handleSave();
     }
     global $beanList;
     // get the EditView defs to check if opportunity_name exists, for a check below for populating data
     $opportunityNameInLayout = false;
     $editviewFile = 'modules/Leads/metadata/editviewdefs.php';
     $this->medataDataFile = $editviewFile;
     if (file_exists("custom/{$editviewFile}")) {
         $this->medataDataFile = "custom/{$editviewFile}";
     }
     include $this->medataDataFile;
     foreach ($viewdefs['Leads']['EditView']['panels'] as $panel_index => $section) {
         foreach ($section as $row_array) {
             foreach ($row_array as $cell) {
                 if (isset($cell['name']) && $cell['name'] == 'opportunity_name') {
                     $opportunityNameInLayout = true;
                 }
             }
         }
     }
     $this->medataDataFile = $this->fileName;
     if (file_exists("custom/{$this->fileName}")) {
         $this->medataDataFile = "custom/{$this->fileName}";
     }
     $this->loadDefs();
     $this->getRecord();
     $this->checkForDuplicates($this->focus);
     $smarty = new Sugar_Smarty();
     $ev = new EditView();
     $ev->ss = $smarty;
     $ev->view = "ConvertLead";
     echo $this->getModuleTitle();
     require_once "include/QuickSearchDefaults.php";
     $qsd = new QuickSearchDefaults();
     $qsd->setFormName("ConvertLead");
     $this->contact = new Contact();
     $smarty->assign("contact_def", $this->contact->field_defs);
     $smarty->assign("form_name", "ConvertLead");
     $smarty->assign("form_id", "ConvertLead");
     $smarty->assign("module", "Leads");
     $smarty->assign("view", "convertlead");
     $smarty->assign("bean", $this->focus);
     $smarty->assign("record_id", $this->focus->id);
     $smarty->display("modules/Leads/tpls/ConvertLeadHeader.tpl");
     echo "<div class='edit view' style='width:auto;'>";
     foreach ($this->defs as $module => $vdef) {
         if (!isset($beanList[$module])) {
             continue;
         }
         $bean = $beanList[$module];
         $focus = new $bean();
         $focus->fill_in_additional_detail_fields();
         foreach ($focus->field_defs as $field => $def) {
             if (isset($vdef[$ev->view]['copyData']) && $vdef[$ev->view]['copyData']) {
                 if ($module == "Accounts" && $field == 'name') {
                     $focus->name = $this->focus->account_name;
                 } else {
                     if ($module == "Opportunities" && $field == 'amount') {
                         $focus->amount = unformat_number($this->focus->opportunity_amount);
                     } else {
                         if ($module == "Opportunities" && $field == 'name') {
                             if ($opportunityNameInLayout && !empty($this->focus->opportunity_name)) {
                                 $focus->name = $this->focus->opportunity_name;
                             }
                         } else {
                             if ($field == "id") {
                                 //If it is not a contact, don't copy the ID from the lead
                                 if ($module == "Contacts") {
                                     $focus->{$field} = $this->focus->{$field};
                                 }
                             } else {
                                 if (is_a($focus, "Company") && $field == 'phone_office') {
                                     //Special case where company and person have the same field with a different name
                                     $focus->phone_office = $this->focus->phone_work;
                                 } else {
                                     if (isset($this->focus->{$field})) {
                                         $focus->{$field} = $this->focus->{$field};
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         //Copy over email data
         $ev->setup($module, $focus, $this->medataDataFile, "modules/Leads/tpls/ConvertLead.tpl", false);
         $ev->process();
         echo $ev->display(false);
         echo $this->getValidationJS($module, $focus, $vdef[$ev->view]);
     }
     echo "</div>";
     echo $qsd->getQSScriptsJSONAlreadyDefined();
     $smarty->display("modules/Leads/tpls/ConvertLeadFooter.tpl");
//.........这里部分代码省略.........
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:101,代码来源:view.convertlead.php


示例18: unformat_number

 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */
$module = $_REQUEST['save_module'];
$record = $_REQUEST['save_record'];
$field_value = $_REQUEST['save_value'];
$field = $_REQUEST['save_field_name'];
$type = $_REQUEST['type'];
$bean = BeanFactory::getBean($module, $record);
if ($type != 'currency') {
    $bean->{$field} = $field_value;
} else {
    $bean->{$field} = unformat_number($field_value);
}
$bean->save(false);
$ret_array = array();
$ret_array['id'] = $record;
$ret_array['field'] = $field;
if ($type != 'currency') {
    $ret_array['value'] = $bean->{$field};
} else {
    global $locale;
    $params = array();
    $params['currency_id'] = $_REQUEST['currency_id'];
    $params['convert'] = false;
    $params['currency_symbol'] = $_REQUEST['currency_symbol'];
    $ret_array['currency_formatted_value'] = currency_format_number($bean->{$field}, $params);
    $ret_array['formatted_value'] = format_number($bean->{$field});
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:31,代码来源:saveInline.php


示例19: unformat_all_fields

 /**
  * Removes formatting from values posted from the user interface.
  * It only unformats numbers.  Function relies on user/system prefernce for format strings.
  *
  * Internal Function, do not override.
  */
 function unformat_all_fields()
 {
     global $disable_num_format, $current_user;
     if (!empty($this->unformated_numbers) || !empty($disable_num_format) || empty($current_user)) {
         return;
     }
     // turned off at bean level?
     if (!empty($this->disable_num_format) && $this->disable_num_format || empty($this->field_defs)) {
         return;
     }
     foreach ($this->field_defs as $fieldDef) {
         $type = empty($fieldDef['type']) ? $fieldDef['dbType'] : $fieldDef['type'];
         $field = $fieldDef['name'];
         if (in_array($type, array('int', 'float', 'double', 'uint', 'ulong', 'long', 'short', 'tinyint', 'currency', 'decimal'))) {
             if (empty($fieldDef['disable_num_format']) && !empty($this->{$field})) {
                 $this->{$field} = unformat_number($this->{$field});
             }
         } else {
             if ($type == 'encrypt' && !empty($this->{$field})) {
                 $this->{$field} = $this->encrpyt_before_save($this->{$field});
             }
         }
     }
     $this->unformated_numbers = true;
 }
开发者ID:Terradex,项目名称:sugar,代码行数:31,代码来源:SugarBean.php


示例20: unformat_number

			$map->links['DEFAULT']->max_bandwidth_in_cfg = $bwin;
			$map->links['DEFAULT']->max_bandwidth_out_cfg = $bwout;
			$map->links['DEFAULT']->max_bandwidth_in = unformat_number($bwin, $map->kilo);
                        $map->links['DEFAULT']->max_bandwidth_out = unformat_number($bwout, $map->kilo);
			
			// $map->defaultlink->SetBandwidth($bwin,$bwout);
			foreach ($map->links as $link)
			{
			    if( ($link->max_bandwidth_in_cfg == $bwin_old) || ($link->max_bandwidth_out_cfg == $bwout_old) )
			    {
	    //			$link->SetBandwidth($bwin,$bwout);
				    $link_name = $link->name;
				    $map->links[$link_name]->max_bandwidth_in_cfg = $bwin;
				    $map->links[$link_name]->max_bandwidth_out_cfg = $bwout;
				    $map->links[$link_name]->max_bandwidth_in = unformat_number($bwin, $map->kilo);
				    $map->links[$link_name]->max_bandwidth_out = unformat_number($bwout, $map->kilo);
			    }
			}
		}

		$map->WriteConfig($mapfile);
		break; 

	case 'set_map_style':
		$map->ReadConfig($mapfile);

		if(wm_editor_validate_one_of($_REQUEST['mapstyle_htmlstyle'],array('static','overlib'),false)) {
		    $map->htmlstyle = strtolower($_REQUEST['mapstyle_htmlstyle']); 		    
		}

		$map->keyfont = intval($_REQUEST['mapstyle_legendfont']);
开发者ID:avillaverdec,项目名称:cacti,代码行数:31,代码来源:editor.php



注:本文中的unformat_number函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP unhtml函数代码示例发布时间:2022-05-23
下一篇:
PHP unformat_float函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap