add i_care code

This commit is contained in:
2024-11-05 08:25:53 +07:00
parent c07a2dba07
commit 67fbe47f87
16 changed files with 813 additions and 221 deletions

No files matched your search

+20
View File
@@ -1,7 +1,9 @@
package utils
import (
"fmt"
"log"
"strconv"
"strings"
)
@@ -43,3 +45,21 @@ func ReplaceGelar(gelar string) string {
gelar = strings.ReplaceAll(gelar, ",", " ")
return gelar
}
func GetNoUrut(noSurKon string) (string, error) {
noSurKonSlice := strings.Split(noSurKon, "/")
noUrut := noSurKonSlice[3]
noUrutInt, err := strconv.Atoi(noUrut)
if err != nil {
return "", err
}
log.Println("No Urut Int: ", noUrutInt)
noUrutInt++
log.Println("No Urut Int: ", noUrutInt)
noUrutStr := fmt.Sprintf("%03d", noUrutInt)
log.Println("No Urut: ", noUrutStr)
return noUrutStr, nil
}