// Configure //-----------------------------------------------------------------------------------
-------
// Function name: ExchangeMoney ($ N_money)
// For use: capital conversion function
// Parameter: $ N_money (number of the amount to be converted)
// Return value: string
// Standby note: This function example: $ char = ExchangeMoney (5645132.3155) =>
$ Char = ¥5,645,132.31
// Configure //-----------------------------------------------------------------------------------
-------
Function ExchangeMoney ($ N_money)
{
$ A_tmp = explode (".", $ N_money); // divide the number into two parts by the decimal point, and store the array $ A_tmp
$ I _len = strlen ($ A_tmp [0]); // measure the width of the digits before the decimal point.
If ($ I _len % 3 = 0)
{
$ I _step = $ I _len/3; // for example, the width of the previous digit mod 3 = 0, which can be divided into $ I _step
Part
} Else
{
$ Step = ($ len-$ len % 3)/3 + 1; // for example, the width of the previous digit mod 3! = 0, which can be divided into $ I _step
Part + 1
}
$ C_cur = "";
// Convert the amount before the decimal point
While ($ I _len <> 0)
{
$ I _step --;
If ($ I _step = 0)
{
$ C_cur. = substr ($ A_tmp [0], 0, $ I _len-($ I _step) * 3 );
} Else
{
$ C_cur. = substr ($ A_tmp [0], 0, $ I _len-($ I _step) * 3 ).",";
}
$ A_tmp [0] = substr ($ A_tmp [0], $ I _len-($ I _step) * 3 );
$ I _len = strlen ($ A_tmp [0]);
}
// Convert the amount after the decimal point
If ($ A_tmp [1] = "")
{
$ C_cur. = ". 00 ";
} Else
{
$ I _len = strlen ($ A_tmp [1]);
If ($ I _len <2)
{
$ C_cur. = ".". $ A_tmp [1]. "0 ";
} Else
{
$ C_cur. = ".". substr ($ A_tmp [1], 0, 2 );
}
}
// Add and transfer the RMB symbol
$ C_cur = "¥". $ C_cur;
Return $ C_cur;
}
// Configure //-----------------------------------------------------------------------------------
-------
// Configure //-----------------------------------------------------------------------------------
------
// Function name: WindowLocation ($ C_url, $ C_get = "", $ C_getOther = "")
// Usage: window. location function in PHP
// Parameter: $ C_url indicates the URL of the redirection window.
// $ C_get method parameters
// $ C_getOther other parameters of the GET method
// Return value: string
// Standby Note: None
// Configure //-----------------------------------------------------------------------------------
-----
Function WindowLocation ($ C_url, $ C_get = "", $ C_getOther = "")
{
If ($ C_get = "" & $ C_getOther = "")
If ($ C_get = "" & $ C_getOther <> "") {$ C_target = "" window. location = $ C_url?
$ C_getOther = + this. value "";}
If ($ C_get <> "" & $ C_getOther = ") {$ C_target =" "window. location = $ C_url?
$ C_get "";}
If ($ C_get <> "" & $ C_getOther <> "") {$ C_target = "" window. location = $ C_url?
$ C_get & $ C_getOther = + this. value "";}
Return $ C_target;
}
// Configure //-----------------------------------------------------------------------------------
-----
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service