Jump to content

paulmagm

Members
  • Posts

    35
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

paulmagm's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks for your help! But.. A. I have to include this "["group"]["groupName"]". $match has no value. B. I have to include $match["matchDateTime"] instead of your timestamp.
  2. I have two other questions (and last questions). A. How can i echo a simple Array without the that $match and automatic repeat? Like <?php echo $match["group"]["groupName"]; ?> B. How can i format that date which this API echo me like. <?php echo $match["matchDateTime"]; ?> I get back this 2024-10-06T09:19:53.660Z I tried it often.. to bring it in Sa., 6.10. - 15:30. But it doesn't work. I have often two dates then in my echo and no good format. Thanks!
  3. I have 5 Games in that table. With the code in my first post. It repeats automatic. the table lines. Team1 Team2 2:1 (all fine) Team1 Team2 1:1 Team1 Team2 0:0 Team1 Team2 0:0 Team1 Team2 0:0 But on the last 4 games i have the [0] haltime result not the [1] finished result like in the first game. And i don't know why. Thanks for your time! Edit: Hm now it works.. maybe it was just in the cache? haha..
  4. Hey, I have a table with match results. <?php foreach ($matches as $match) { ?> $match["matchResults"][0]["pointsTeam1"] $match["matchResults"][1]["pointsTeam1"] n the first line i have the score [1] (game finished) on all other lines (td) i have the score [0] halftime score. How can i change it that in every line i have [1] with finished score? Maybe you can help me. Thanks! <?php foreach ($matches as $match) { ?> <tr><td></td> <td><img src="<?php echo $match["team1"]["teamIconUrl"]; ?>" height="25"></td> <td class="result"> <?php echo $match["matchResults"][1]["pointsTeam1"]; ?> : <?php echo $match["matchResults"][1]["pointsTeam2"]; ?> </td> <td><img src="<?php echo $match["team2"]["teamIconUrl"]; ?>" height="25"></td> </tr> <?php } ?> Thanks
  5. i have both when it's 0. 0--. And i try to hide the 0 when the result is zero. I want to replace it with --.
  6. 0 if its not available. otherwise it will deliver the number.
  7. max_supply is a number. what else? maybe you should go for a forum only for solutions. i will ask somewhere else for help.
  8. Hey i have a little function like <?php echo number_format($max_supply, 0, '.', '.'); if($max_supply ==0) { echo "--"; } ?> But i still have a 0 before "--" how can i hide this 0.
  9. Found a solution with the function on top.
  10. Yes thank you. Do you have a tipp for the problem that i dont want $ 65.400,678956 but i need to display $ 0,000134. With one value like $price.
  11. Yes this is no problem but after the , how can i handle this that big prices set a 0 with number_format. But then my small prices like 0,00004 only looks like 0. i only have $price.
  12. What would be the best way to implement a numbers helper in my CMS? I have to show prices sometimes $ 45.555,64549 and $ 0,00067 and supply like 113.122.122,4567. Thank you.
  13. Page is empty from this point.. but no error. Also with error_reporting(E_ALL);
  14. function price_format($price, $decimals = 2) { $CI =& get_instance(); $config = $CI->config->item('mcp'); $price = (float) $price; $formats = ["US" => ['.', ','], "EU" => [',', '.']]; $decimals = ($price >= 1 || $price == 0) ? $decimals : ($price < 0.000001 ? 8 : 6); return number_format($price, $decimals, $formats[$config['num_format']][0], $formats[$config['num_format']][1]); $coinfeed_coingecko_json = file_get_contents('https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids='.$t['page.content_slug'].''); $coinfeed_json = json_decode($coinfeed_coingecko_json, false); $coinfeed_current_price = $coinfeed_json[0]->current_price; $coinfeed_current_supply = $coinfeed_json[0]->circulating_supply; $coinfeedprice_change_percentage_24h = $coinfeed_json[0]->price_change_percentage_24h; $coinfeed_ath = $coinfeed_json[0]->ath; ?> <?php echo $coinfeedde = number_format($coinfeed_current_price, 0, '.', '.'); ?> I created my first api call and now i trying to connect it to my old numbers helper (function price_format). How can i connect this function with my new api call? If i replace $price it will not work. Thanks for your time guys.
  15. yes, thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.