public static function create($value, $scale = null, $removeZeros = false)
{
if (is_int($value)) {
return self::fromInteger($value);
} elseif (is_float($value)) {
return self::fromFloat($value, $scale, $removeZeros);
} elseif (is_string($value)) {
return self::fromString($value, $scale, $removeZeros);
} elseif ($value instanceof Decimal) {
return self::fromDecimal($value, $scale);
} else {
throw new InvalidArgumentTypeException(['int', 'float', 'string', 'Decimal'], is_object($value) ? get_class($value) : gettype($value), 'Invalid argument type.');
}
}