For example, encounter a very large file 49957289167B, we see a long string of numbers behind the unit is byte B, or do not know the size of this file is a concept, we convert it to GB, that is 46.53GB. The following functions are used to accomplish
Number_format (288);
Output 288
Number_format (365,2);
Output 365.00
Number_format (365000000,3, ".") (The number 365000000 is reserved for 3 decimal places, and the decimal point is ".") Said
Function Format (const format: string; const ARGs: array of const): string;
Format String description:"%" [Index ":"] ["-"] [width] ["." prec] Type(1) The formatted string must start with %(2) [Index ":"] index refers to the serial number of each
I read Andrew's original text again. In the comments below the original text, I found that some people raised the number of parameters early, similarly, the lazy Lou pig directly copied the original article and commented and replied. At the same
Copy codeThe Code is as follows:
retrieve page width
display current dimensions mobile phone bills, Q coins, game recharge width ()-return the width of the element. height ()-returns the height of the element. the innerWidth ()
I attended the C # training a few days ago and found that the format parameter replacement function is really practical, especially when writing SQL statements, such as an SQL statement.
Insert into (F1, F2, F3) values (V1, V2, V3)
If you want to
Today, the Windows code is ported to Linux, which uses the Unicode to char function, was a pit, related functions and encoding format, Linux and Windows, there are a few points to note:1, the wchar_t occupies 4 bytes under Linux, occupies 2 bytes
Function: From_unixtimerole: The time in MySQL stored in int (11) is displayed in "YYYY-MM-DD" format.Syntax: From_unixtime (Unix_timestamp,format)
Returns a String representing the Unix time token, formatted according to the format string. FORMAT
This function is often used to share with everyone.
Function code:
Copy Code code as follows:
Date.prototype.format = function (format) {
var o = {
"m+": This.getmonth () +1,//month
"D+": This.getdate (),//day
"h+": this.gethours (),/
1 After the value of the format
{0:D} small: Like 2005-5-6
{0:D} large: As of May 6, 2005
{0:f} full type
2 Current Time acquisition
DateTime.Now.ToShortDateString
3 format in Values
Date format conversion methods that may be used frequently
Copy Code code as follows:
Get page Width
Display current various sizes Mobile phone bill, Q currency, game recharge width ()-Returns the width of the element. height ()-Returns the height of the element. The innerwidth ()
Editor: Today to share a JS implementation of similar C # format method. The formatted output of the string is helpful to the string conversion and formatting display.
Body:
Directly on the code:
The code is as follows
Copy Code
JavaScript provides part of the number format method, but not perfect, you can look at the use of the number object, which provides some formatted output of numbers, several functions are as follows:
Toexponential ([fractiondigits]): Returns the
In the use of WordPress process, often need to format the date of WordPress, in PHP format or Date function is date (), but in WordPress using the The_time () function to format the WordPress time and date, Their usage is essentially the same, but
Copy Code code as follows:
//--------------------------------------------
Delete the thousand points.
//--------------------------------------------
function Removecomma (number) {
var num = number.replace (new RegExp (",", "G"), "");
if
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.