当前位置: 首页>>代码示例>>PHP>>正文


PHP Okapi::cache_size2_to_oxsize方法代码示例

本文整理汇总了PHP中okapi\Okapi::cache_size2_to_oxsize方法的典型用法代码示例。如果您正苦于以下问题:PHP Okapi::cache_size2_to_oxsize方法的具体用法?PHP Okapi::cache_size2_to_oxsize怎么用?PHP Okapi::cache_size2_to_oxsize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在okapi\Okapi的用法示例。


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

示例1: call


//.........这里部分代码省略.........
                         case 'nano':
                             $entry['size'] = 1.0;
                             break;
                             # same as micro
                         # same as micro
                         case 'micro':
                             $entry['size'] = 1.0;
                             break;
                         case 'small':
                             $entry['size'] = 2.0;
                             break;
                         case 'regular':
                             $entry['size'] = 3.0;
                             break;
                         case 'large':
                             $entry['size'] = 4.0;
                             break;
                         case 'xlarge':
                             $entry['size'] = 5.0;
                             break;
                         case 'other':
                             $entry['size'] = null;
                             break;
                             # same as none
                         # same as none
                         default:
                             throw new Exception();
                     }
                     break;
                 case 'size2':
                     $entry['size2'] = Okapi::cache_sizeid_to_size2($row['size']);
                     break;
                 case 'oxsize':
                     $entry['oxsize'] = Okapi::cache_size2_to_oxsize(Okapi::cache_sizeid_to_size2($row['size']));
                     break;
                 case 'difficulty':
                     $entry['difficulty'] = round($row['difficulty'] / 2.0, 1);
                     break;
                 case 'terrain':
                     $entry['terrain'] = round($row['terrain'] / 2.0, 1);
                     break;
                 case 'trip_time':
                     # search time is entered in hours:minutes and converted to decimal hours,
                     # which can produce lots of unneeded decimal places; 2 of them are sufficient here
                     $entry['trip_time'] = $row['trip_time'] === null ? null : round($row['trip_time'], 2);
                     break;
                     break;
                 case 'trip_distance':
                     # way length is entered in km as decimal fraction, but number conversions can
                     # create fake digits which should be stripped; meter precision is sufficient here
                     $entry['trip_distance'] = $row['trip_distance'] === null ? null : round($row['trip_distance'], 3);
                     break;
                     break;
                 case 'rating':
                     if ($row['votes'] < 3) {
                         $entry['rating'] = null;
                     } elseif ($row['score'] >= 2.2) {
                         $entry['rating'] = 5.0;
                     } elseif ($row['score'] >= 1.4) {
                         $entry['rating'] = 4.0;
                     } elseif ($row['score'] >= 0.1) {
                         $entry['rating'] = 3.0;
                     } elseif ($row['score'] >= -1.0) {
                         $entry['rating'] = 2.0;
                     } else {
                         $entry['rating'] = 1.0;
开发者ID:Slini11,项目名称:okapi,代码行数:67,代码来源:geocaches.php


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