/
githubmirror
/
ydb-php-sdk
Обзор
Документация
Войти
/
githubmirror
/
ydb-php-sdk
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Types/DecimalType.php
52 строки
849 B
Alexei Shabalin
namespace updated
20 дек 2022, 15:20
20 дек 2022, 15:20
e4410bc
Код
Авторство
О чём код?
<?php namespace YdbPlatform\Ydb\Types; class DecimalType extends AbstractType { /** * @var int */ protected $digits = 10; /** * @var int */ protected $scale = 2; /** * @param int $digits * @return $this */ public function digits($digits) { $this->digits = $digits; return $this; } /** * @param int $scale * @return $this */ public function scale($scale) { $this->scale = $scale; return $this; } /** * @inherit */ protected function normalizeValue($value) { return (float)$value; } /** * @inherit */ protected function getYqlString() { return 'Decimal(' . $this->quoteString($this->value) . ', ' . $this->digits . ', ' . $this->scale . ')'; } }