Piwik\Common::forceDotAsSeparatorForDecimalPoint PHP Method

forceDotAsSeparatorForDecimalPoint() public static method

Force the separator for decimal point to be a dot. See https://github.com/piwik/piwik/issues/6435 If for instance a German locale is used it would be a comma otherwise.
public static forceDotAsSeparatorForDecimalPoint ( float | string $value ) : string
$value float | string
return string
    public static function forceDotAsSeparatorForDecimalPoint($value)
    {
        if (null === $value || false === $value) {
            return $value;
        }
        return str_replace(',', '.', $value);
    }

Usage Example

Exemplo n.º 1
0
 public function setAxisYValues(&$values)
 {
     foreach ($values as $label => &$data) {
         $this->series[] = array('label' => $label, 'internalLabel' => $label);
         array_walk($data, function (&$v) {
             $v = (double) Common::forceDotAsSeparatorForDecimalPoint($v);
         });
         $this->data[] =& $data;
     }
 }
All Usage Examples Of Piwik\Common::forceDotAsSeparatorForDecimalPoint