0
I am implementing Ckeckout Cielo and it is always returned numerical values for prices.
Monetary values are always treated as integer values, without representation of decimal places, and the last two digits are considered as cents.
Exemplo: R$ 1.286,87 é representado como 128687 e R$ 1,00 é representado como 100
I think about using the function of substr_replace
to add (.)
before the last two houses, as in the following example::
substr_replace(100000, '.', -2,0) = 1000.00
substr_replace(100, '.', -2,0) = 1.00
In this context, apply the substr_replace
for recording decibel values in the database Mysql
would be suitable for any monetary value coming from Cielo?
divided by
100
!!!– novic
have to find out if this is the way it is, as in the example
128687
if formatting no correct is split by100
, if the number has decimal places the bank will record if not also, but what would be nice is to check with CIELO or manual if it is like that.– novic
@Virgilio Novic the first example was taken in full from the Cielo manual.
– Dagobe
then do the division by
100
! the value could already be saved in the base!– novic