update code for tipe surkon
This commit is contained in:
No files matched your search
@@ -1,7 +1,9 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -43,3 +45,17 @@ 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
|
||||
}
|
||||
|
||||
noUrutInt++
|
||||
noUrutStr := fmt.Sprintf("%03d", noUrutInt)
|
||||
log.Println("No Urut: ", noUrutStr)
|
||||
return noUrutStr, nil
|
||||
}
|
||||
Reference in New Issue
Block a user