Int64.From แปลงค่าต่างๆ เช่น ตัวเลข (number) ข้อความ (text) เป็นประเภทข้อมูล Int64 ซึ่งเป็นจำนวนเต็ม 64-bit ที่มีช่วงค่าตั้งแต่ -9223372036854775808 ถึง 9223372036854775807 ใช้สำหรับตัวเลขที่ใหญ่เกินไปสำหรับ Int32 เช่น timestamp ตัวเลข ID ขนาดใหญ่
=Int64.From(value as any, optional culture as nullable text) as nullable number
=Int64.From(value as any, optional culture as nullable text) as nullable number
| Argument | Type | Required | Default | Description |
|---|---|---|---|---|
| value | any | Yes | ค่าที่ต้องการแปลง (number, text ฯลฯ) | |
| culture | text | Optional | null | สำนัก (culture) สำหรับการแปลงข้อความ |
แปลงค่า timestamp Unix ที่มีขนาดใหญ่เป็น Int64
แปลงข้อมูล ID ขนาดใหญ่สำหรับระบบที่ต้อง Int64
ใช้สำหรับการคำนวณที่ต้องช่วงตัวเลขขนาดใหญ่
Int64.From(9000000000000)=Int64.From(9000000000000)
9000000000000
Int64.From("1672444800000")=Int64.From("1672444800000")
1672444800000
Int64.From(-9223372036854775808)=Int64.From(-9223372036854775808)
-9223372036854775808
Int32.From มีช่วง -2.1 พันล้าน ถึง 2.1 พันล้าน ส่วน Int64.From มีช่วงมากกว่ามากหลายเท่า (-9.2 ล้านล้าน ถึง 9.2 ล้านล้าน) ใช้ Int64.From เมื่อต้องตัวเลขขนาดใหญ่
ได้แต่จะปัดเศษเป็นจำนวนเต็ม เช่น 1000.9 จะแปลงเป็น 1001
ใช้ Int64 เมื่อต้องจำนวนเต็มขนาดใหญ่ ใช้ Number เมื่อต้องตัวเลข floating-point
ฟังก์ชัน Int64.From ใช้เพื่อแปลงค่าต่างๆ เช่น ตัวเลข ข้อความ เป็นประเภทข้อมูล 64-bit integer ที่มีช่วงค่ามากกว่า Int32