package format

import "strconv"

// Rupiah memformat bilangan bulat menjadi teks rupiah berpemisah titik.
func Rupiah(n int) string {
	s := strconv.Itoa(n)
	if len(s) <= 3 {
		return "Rp" + s
	}
	hasil := ""
	for len(s) > 3 {
		hasil = "." + s[len(s)-3:] + hasil
		s = s[:len(s)-3]
	}
	return "Rp" + s + hasil
}
