2017 © Pedro PelĂĄez
 

project float

Converter and wrapping object for a float value

image

granam/float

Converter and wrapping object for a float value

  • Tuesday, July 10, 2018
  • by jaroslavtyc
  • Repository
  • 1 Watchers
  • 1 Stars
  • 7,431 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 17 Versions
  • 5 % Grown

The README.md

Converter and object wrapper for float value

Build Status, (*1)

Hint

First of all, make sure you don't need just a simple built-in float validation., (*2)

<?php
use Granam\Float\FloatObject;

$float = new FloatObject(123.456);

// double(123.456)
var_dump($float->getValue());
// string(7) "123.456"
var_dump((string)$float);

$float = new FloatObject(null);
// double(0)
var_dump($float->getValue());
// string(0)
var_dump((string)$float);

$float = new FloatObject($withTooLongDecimal = '123456.999999999999999999999999999999999999');
// double 123457
var_dump($float->getValue());

try {
  new FloatObject('123.999999999999999999999999999999', true /* paranoid to rounding */);
} catch (\Granam\Float\Tools\Exceptions\WrongParameterType $floatException) {
  // Something get wrong: Some value has been lost on cast. Given string-number '123456.999999999999999999999999999999999999' results into float 123457
  die('Something get wrong: ' . $floatException->getMessage());
}

The Versions

10/07 2018

5.0.x-dev

5.0.9999999.9999999-dev https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php float strict

10/07 2018

5.0.0

5.0.0.0 https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php float strict

10/07 2018

dev-master

9999999-dev https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php float strict

19/02 2017

4.0.x-dev

4.0.9999999.9999999-dev https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php float strict

19/02 2017

4.0.1

4.0.1.0 https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php float strict

17/02 2017

4.0.0

4.0.0.0 https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php float strict

17/02 2017

3.0.x-dev

3.0.9999999.9999999-dev https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php float strict

17/02 2017

3.0.0

3.0.0.0 https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php float strict

10/09 2015

2.1.x-dev

2.1.9999999.9999999-dev https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php number float strict

02/09 2015

2.1.0

2.1.0.0 https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php number float strict

18/08 2015

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php number float strict

18/08 2015

2.0.2

2.0.2.0 https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php number float strict

17/08 2015

2.0.1

2.0.1.0 https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php number float strict

17/08 2015

2.0.0

2.0.0.0 https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php number float strict

21/07 2015

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php float strict

21/07 2015

1.0.1

1.0.1.0 https://github.com/jaroslavtyc/granam-float

Converter and wrapping object for a float value

  Sources   Download

MIT

The Requires

 

The Development Requires

php float strict

23/06 2015