Skip to main content

Text.From

Δημιουργεί μια τιμή κειμένου από την παρεχόμενη τιμή.

Syntax

Text.From(
value as any,
optional culture as text
) as text

Remarks

Returns the text representation of a specified value.

  • value: The value to convert to text. The value can be a number, date, time, datetime, datetimezone, logical, duration, or binary value. If the given value is null, this function returns null.
  • culture: (Optional) The culture to use when converting the value to text (for example, "en-US").

Examples

Example #1

Δημιουργήστε μια τιμή κειμένου από τον αριθμό 3.

Text.From(3)

Result:

"3"

Example #2

Λάβετε το ισοδύναμο κειμένου της καθορισμένης ημερομηνίας και ώρας.

Text.From(#datetime(2024, 6, 24, 14, 32, 22))

Result:

"6/24/2024 2:32:22 PM"

Example #3

Λάβετε το ισοδύναμο γερμανικού κειμένου της καθορισμένης ημερομηνίας και ώρας.

Text.From(#datetime(2024, 6, 24, 14, 32, 22), "de-DE")

Result:

"24.06.2024 14:32:22"

Example #4

Λάβετε μια δυαδική τιμή από κείμενο κωδικοποιημένο ως δεκαεξαδικό και αλλάξτε την τιμή ξανά σε κείμενο.

Text.From(Binary.FromText("10FF", BinaryEncoding.Hex))

Result:

"EP8="

Example #5

Λάβετε τις γραμμές του πίνακα που περιέχουν δεδομένα για τη Γαλλία και μετατρέψτε τις ημερομηνίες σε κείμενο χρησιμοποιώντας τη γαλλική κουλτούρα.

let
Source = #table(type table [Company ID = text, Country = text, Date = date],
{
{"JS-464", "USA", #date(2024, 3, 24)},
{"LT-331", "France", #date(2024, 10, 5)},
{"XE-100", "USA", #date(2024, 5, 21)},
{"RT-430", "Germany", #date(2024, 1,18)},
{"LS-005", "France", #date(2023, 12, 31)},
{"UW-220", "Germany", #date(2024, 2, 25)}
}),
#"Convert Dates" = Table.TransformColumns(
Table.SelectRows(Source, each [Country] = "France"),
{"Date", each Text.From(_, "fr-FR")}
)
in
#"Convert Dates"

Result:

#table(type table [Company ID = text, Country = text, Date = text],
{
{"LT-331", "France", "05/10/2024"},
{"LS-005", "France", "31/12/2023"}
})

Category

Text.Conversions from and to text