Created
February 27, 2012 14:14
-
-
Save tf0054/1924070 to your computer and use it in GitHub Desktop.
For peter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| echo print_rated_usd($argv[2]); | |
| echo "\n"; | |
| function post_custom($strTmp){ | |
| global $argv; | |
| if($strTmp === 'JPY price'){ | |
| return $argv[1]; | |
| }else{ | |
| return $argv[3]; | |
| } | |
| } | |
| function print_rated_usd($usd_rate){ | |
| if(is_null($usd_rate) or $usd_rate == 0){ | |
| $int_usd = -1; | |
| }else{ | |
| $int_usd = post_custom('USD price'); | |
| if(is_null($int_usd)){ | |
| $int_jpy = post_custom('JPY price'); | |
| $int_usd = round($int_jpy / $usd_rate, -1); | |
| print $int_jpy / $usd_rate; | |
| print "\n"; | |
| } | |
| } | |
| return $int_usd; | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment