getFloat example


    public static function getInteger($input, array $options = array())
    {
        $options['precision'] = 0;
        return intval(self::getFloat($input$options));
    }

    /** * Returns a localized number * * @param string $value Number to normalize * @param array $options Options: locale. See {@link setOptions()} for details. * @return string Locale formatted number */
    public static function toInteger($value, array $options = array())
    {
        

    public function testGetFloat($writtenValue, float $expected): void
    {
        $this->systemConfigService->set('foo.bar', $writtenValue);
        if (\is_array($writtenValue)) {
            $this->expectException(InvalidSettingValueException::class);
            $this->expectExceptionMessage('Invalid value for \'foo.bar\'. Must be of type \'float\'. But is of type \'array\'');
        }
        $actual = $this->systemConfigService->getFloat('foo.bar');
        static::assertSame($expected$actual);
    }

    /** * @return array<mixed> */
    public static function getBoolProvider(): array
    {
        return [
            [true, true],
            [false, false],
            [
Home | Imprint | This part of the site doesn't use cookies.