How to convert an integer to a Dominican peso format in PHP?

0

I am developing a loan system, for a client from the Dominican Republic, and I need to develop a currency format, which is the same as there, I am using the function.

<?php 
 number_format($number, 2);
?>

But the client tells me that the figures that this function shows are not correct, and I would like to make the converter in his currency.

I would appreciate your help friends :)

    
asked by GameOverNOT 22.06.2018 в 13:58
source

2 answers

0

But $ is directly in Dominican pesos or in another currency? If the number you have is in euros for example you could convert it and show it in the following way:

$numero = 5;
$diferencia = 0.0173022259;
$total = number_format($numero / $diferencia, 2);
echo $total + "pesos dominicanos";

The result of this example would be: 288.98 Dominican pesos

    
answered by 22.06.2018 / 16:25
source
0

Hi, I think the simplest thing is for you to calculate the amount of money we put:

$euro_dolar = 1.36;//Relacion 1€ 1.36$

Then the numerical value to show is:

 number_format($number*$euro_dolar, 2);

In this way you multiply the value $numero in € to obtain the value in $ and display it with the format 2 of number_format

    
answered by 22.06.2018 в 14:08