Author

Topic: api script (Read 172 times)

hero member
Activity: 615
Merit: 502
October 04, 2017, 06:58:37 AM
#3
Solved its

Code:
echo ''. number_format($obj['last'],4) . ''; [/insert_php] EURO

I should have called the API first to know what the format was, I though you meant after the decimal place Smiley
hero member
Activity: 615
Merit: 502
October 04, 2017, 06:04:34 AM
#2
I got this script for Gulden I have 1 question
Code:
Laatst gekocht = [insert_php]
$url = 'https://www.nocks.com/api/market?call=nlg';
$response = file_get_contents($url);
$obj = json_decode($response, true);
echo ''. $obj['last'] . ''; [/insert_php] EURO

Its show with 0000 after the price, I think its someting from the $obj
My question I wat delete the 0000 after the ,

Try changing the output line to:

Code:
echo ''. number_format($obj['last'],0) . ''; [/insert_php] EURO
member
Activity: 183
Merit: 11
October 04, 2017, 05:37:25 AM
#1
I got this script for Gulden I have 1 question
Code:
Laatst gekocht = [insert_php]
$url = 'https://www.nocks.com/api/market?call=nlg';
$response = file_get_contents($url);
$obj = json_decode($response, true);
echo ''. $obj['last'] . ''; [/insert_php] EURO

Its show with 0000 after the price, I think its someting from the $obj
My question I wat delete the 0000 after the ,
Jump to: