Hey. Stumped over here.
I have a JSON string returning data from a payment API, it is implemented into my html code via PHP:
The issue is that the API pulls in number values only with no decimal conversion on the API end. My system is converting the number to a decimal which is one decimal place off from where it should be.
For example:
Returned from API: Total: 500 (Not converted json value)
Total: $500.00 (What I see)
Total: $5.00 (What I want)
Here is the snippet of code that I am using in my HTML file to show the data.
<?php echo ((isset($processData['original_total_charged']) && !empty($processData['original_total_charged'])) ? $this->Number->currency($processData['original_total_charged'], Configure::read('PAYMENT_SETTINGS.Currency')): ""); ?>
"original_total_charged" being the id of the number string being returned.
Where is my issue? I feel that I understand what the issue is; but I don't know WHERE I've made my mistake. My system is built with mvc and cake php