mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-05 13:46:51 +08:00
21 lines
347 B
Go
21 lines
347 B
Go
package number
|
|
|
|
import (
|
|
"fmt"
|
|
"strconv"
|
|
)
|
|
|
|
// Takes the input value, increments it, and formats it as a string.
|
|
func IncrementStringInt(value string) (string, error) {
|
|
numericValue, err := strconv.Atoi(value)
|
|
if err != nil {
|
|
return value, err
|
|
}
|
|
|
|
numericValue++
|
|
|
|
stringValue := fmt.Sprintf("%v", numericValue)
|
|
|
|
return stringValue, nil
|
|
}
|