Declination of monetary units depending on the entered PHP digit

Suppose we have prices stored in the program as integers, but in fact - the last two digits of the number denote pennies. For example, the price of a product is stored as 10050, which means that the product costs 100 rubles 50 kopecks. Write a program that will display the price in two formats “N rubles[ey/ya] M kopecks[ek/ki].” and “N.M rubles .” while increasing the price of the goods by 13 percent. In the program, use the % operator ($a % $b is the integer remainder of dividing $a by $b).


Ответы (0 шт):