撰寫訊息中...

根據指定格式將數字轉換成文字。

使用範本

TEXT(1.23,"$0.00")

TEXT(A2,"#.###")

TEXT(24,"#.0?")

TEXT(DATE(1969,7,20),"yyyy-MM")

語法

TEXT(數字, 格式)

  • number 要轉換成其他格式的數字、日期或時間。

  • 格式 轉換數字時要採用的模式 (刮在引號中)。 quotation marks.

    • 0 forces display of zeros if a number has fewer digits than the format specifies. 舉例來說,TEXT(12.3,"000.00") produces 012.30. Numbers which have more digits to the right of the decimal point than the pattern are rounded to the indicated number of places. 舉例來說,TEXT(12.305,"00.00") results in 12.31.

    • # is similar to 0 but does not force the display of zeros on either side of the decimal point. 舉例來說,TEXT(12.3,"###.##") produces 12.3.

附註

  • 發生瀏覽後轉換之後,(DFA) Floodlight 銷售廣告代碼所傳送的 格式 的引數撰寫訊息中... cannot contain an asterisk (*).

  • 撰寫訊息中... does not support the ? pattern in Google Sheets.

  • 撰寫訊息中... does not support fractional format patterns.

  • 撰寫訊息中... supports the following date and time patterns:

    • for the day of the month as one or two digits.

    • dd for the day of the month as two digits.

    • ddd for the short name of the day of the week.

    • dddd for the full name of the day of the week.

    • m for the month of the year as one or two digits or the number of minutes in a time. Month will be used unless this code is provided with hours or seconds as part of a time.

    • mm for the month of the year as two digits or the number of minutes in a time. Month will be used unless this code is provided with hours or seconds as part of a time.

    • mmm for the short name of the month of the year.

    • mmmm for the full name of the month of the year.

    • mmmmm for the first letter in the month of the year.

    • YY for the year as two digits.

    • yyyy for the year as four digits.

    • H時 for the hour on a 24-hour clock.

    • H時 for the hour on a 12-hour clock.

    • ss for the seconds in a time.

    • ss.000 for milliseconds in a time.

    • 上午/下午 for displaying hours based on a 12-hour clock and showing AM or PM depending on the time of day.

  • Note that the date/time patterns and # or 0 cannot be mixed.

另請參閱

T: 傳回轉換成文字的字串引數。

FIXED: 將數字轉換成固定小數位數。

DOLLAR: 將數字轉換成指定語言版本的貨幣格式。

範例

這對您有幫助嗎?
我們應如何改進呢?