convertthai

package module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2025 License: MIT Imports: 5 Imported by: 0

README

convert-thai-go ✨

This package helps to format dates according to Thai standards and convert numbers to Thai text, making it suitable for applications that need to display data in Thai specifically. (แพคเกจนี้ช่วยจัดรูปแบบวันที่ตามมาตรฐานไทยและแปลงตัวเลขให้เป็นข้อความภาษาไทย ทำให้เหมาะกับแอพพลิเคชันที่ต้องการแสดงข้อมูลเป็นภาษาไทยโดยเฉพาะ)

Go Report Card License

Install (ติดตั้ง) 🛠️

go get github.com/SaimCore/convert-thai-go

How to use (วิธีใช้งาน) 💡

package main

import (
  "fmt"
  "time"
  "github.com/SaimCore/convert-thai-go"
)

func main(){
  // แปลงเลขอารบิกเป็นเลขไทย
  num := convertthai.NumberFormat(1000, 2, true)
  fmt.Println(num) // ผลลัพธ์ ๑,๐๐๐.๐๐

  // แปลงวันที่เป็นรูปแบบไทย
  date := convertthai.DateFormat(time.Now(),"dd-mm-yyyy")
  fmt.Println(date) // ผลลัพธ์ ๒๙-๐๘-๒๐๒๔

  // แปลงจำนวนเงินเป็นรูปแบบไทยบาท
  thaiBath := convertthai.ThaiBath(1000)
  fmt.Println(thaiBath) // ผลลัพธ์ หนึ่งพันบาทถ้วน
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DateFormat

func DateFormat(date interface{}, format string) string

func NumberFormat

func NumberFormat(number float64, decimals int, thousandsSeparator bool) string

func ThaiBath

func ThaiBath(number float64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL