Beispiel #1
0
 /**
  * Testar transformacao de str para value.
  */
 public function testValue()
 {
     $val = Num::value('1234,877', 2);
     $this->assertEquals(1234.88, $val);
     $val = Num::value('1234,8778', 3);
     $this->assertEquals(1234.878, $val);
 }
Beispiel #2
0
 /**
  * Tratar numeros.
  *
  * @param $model
  * @param $name
  * @param $value
  * @param Request $request
  */
 protected function applyFloat($model, $name, $value, Request $request)
 {
     $model->{$name} = Num::value($value);
 }