Created
November 4, 2019 15:28
-
-
Save sungraizfaryad/a2f2b1443ad109c3c729f2a93d1faf2b to your computer and use it in GitHub Desktop.
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 | |
| function inspiry_readable_price_format($price){ | |
| // first strip any formatting; | |
| $price = (0+str_replace(",","",$price)); | |
| // now filter it; | |
| if($price>1000000000000){ | |
| $price = round(($price/1000000000000),1). esc_html__(' T', 'easy-real-estate'); | |
| } | |
| else if($price>1000000000) { | |
| $price = round(($price/1000000000),1). esc_html__(' B', 'easy-real-estate'); | |
| } | |
| else if($price>1000000){ | |
| $price = round(($price/1000000),1). esc_html__(' M', 'easy-real-estate'); | |
| } | |
| else if($price>1000) { | |
| $price = round(($price/1000),1). esc_html__(' K', 'easy-real-estate'); | |
| } | |
| return $price; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment