B
B
BonBon Slick2018-02-03 11:13:22
PHP
BonBon Slick, 2018-02-03 11:13:22

If the number in the database is decimal, which typehint should I do, double or float?

After all, in fact, it comes to me purely with a dot all the time, I have a decimal of this format

* @ORM\Column(type="decimal", precision=9, scale=2, options={"unsigned": true,})

However, there is no such type in php, please tell me what typehint to put and why?
function getDecimal() : float ? double
{
return 9999.99;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-02-03
@BonBonSlick

However, there is no such type in php

You answered your own question, in php there are no data types like double, long double, and short, long, long long.
float, because there are no other types for floating point numbers in php.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question