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


PHP float::getValue方法代码示例

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


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

示例1: divide

 /**
  * Divides $this by $divisor and returns a new value object.
  * Uses the default rounding method (ROUND_HALF_EVEN) which is preferred for financial calculations.
  * @param Money|int|float|string $divisor
  * @return Money|string
  */
 public function divide($divisor)
 {
     if ($divisor instanceof Money) {
         return $this->mathProvider->divide($this->getValue(), $divisor->getValue(), MathProvider::ROUND_MODE_NONE);
     } else {
         return new static($this->mathProvider->divide($this->getValue(), (string) $divisor), $this->mathProvider);
     }
 }
开发者ID:lusitanian,项目名称:phpmoney,代码行数:14,代码来源:Money.php

示例2: getVersionPreview

 /**
  * @see Object_Class_Data::getVersionPreview
  * @param float $data
  * @return float
  */
 public function getVersionPreview($data)
 {
     if ($data instanceof \Object_Data_QuantityValue) {
         return $data->getValue() . " " . $data->getUnit()->getAbbreviation();
     }
     return "";
 }
开发者ID:rolandstoll,项目名称:pimcore,代码行数:12,代码来源:QuantityValue.php

示例3: getVersionPreview

 /**
  * @see Object_Class_Data::getVersionPreview
  * @param float $data
  * @param null|Model\Object\AbstractObject $object
  * @param mixed $params
  * @return float
  */
 public function getVersionPreview($data, $object = null, $params = [])
 {
     if ($data instanceof \Pimcore\Model\Object\Data\QuantityValue) {
         $unit = "";
         if ($data->getUnitId()) {
             $unitDefinition = Model\Object\QuantityValue\Unit::getById($data->getUnitId());
             if ($unitDefinition) {
                 $unit = " " . $unitDefinition->getAbbreviation();
             }
         }
         return $data->getValue() . $unit;
     }
     return "";
 }
开发者ID:pimcore,项目名称:pimcore,代码行数:21,代码来源:QuantityValue.php

示例4: direct

 /**
  * Ceil a float
  * 
  * @param \Scalar\Float $float eg 13.22222
  * @return float eg 14.0
  */
 public function direct(float $float)
 {
     return ceil($float->getValue());
 }
开发者ID:void-sector,项目名称:scalar-objects,代码行数:10,代码来源:Ceil.php

示例5: marshallFloat

 /**
  * Marshall a QTI float datatype into its PCI JSON Representation.
  *
  * @param \qtism\common\datatypes\Float $float
  * @return array
  */
 protected function marshallFloat(float $float)
 {
     return array('base' => array('float' => $float->getValue()));
 }
开发者ID:hutnikau,项目名称:qti-sdk,代码行数:10,代码来源:Marshaller.php

示例6: getRadiusOfCurvaturePrimeVertical

 /**
  * Get the Radius of Curvature along the Prime Vertical at a specified latitude
  * for this Reference Ellipsoid object
  *
  * The formula used here is from http://www.epsg.org/guides/docs/G7-2.pdf
  *
  * @param     integer|float    $latitude    Angle of Latitude for the Radius of Curvature,
  *                                              positive when to the north of the equator, negative when to the south
  * @param     string           $degrad      Indicating whether the Angle of Latitude is being specified
  *                                              in degrees or radians
  * @param     string           $uom         Unit of Measure for the returned value
  * @return    float            The Radius of Curvature along the Prime Vertical at the specified latitude
  *                                 for this ellipsoid
  * @throws    Exception
  */
 public function getRadiusOfCurvaturePrimeVertical($latitude = null, $degrad = Angle::DEGREES, $uom = Distance::METRES)
 {
     $latitude = LatLong::validateLatitude($latitude, $degrad);
     if ($this->dirty) {
         $this->calculateDerivedParameters();
     }
     $radius = $this->semiMajorAxis->getValue() / pow(1 - $this->firstEccentricitySquared * self::sinSquared($latitude), 0.5);
     return Distance::convertFromMeters($radius, $uom);
 }
开发者ID:markbaker,项目名称:phpgeodetic,代码行数:24,代码来源:ReferenceEllipsoid.php

示例7: testAddDoubles

 /**
  * Testing addition of two Double values.
  *
  * @since 1.0
  */
 public function testAddDoubles()
 {
     $this->dbl1 = new Double(1.25);
     $this->dbl2 = new Double(3.5);
     $this->assertEquals(4.75, $this->dbl1->getValue() + $this->dbl2->getValue(), 'testing addition of two Double values');
 }
开发者ID:alphadevx,项目名称:alpha,代码行数:11,代码来源:DoubleTest.php


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