gitlab.com/evatix-go/core@v1.3.55/converters/StringToIntegerDefault.go (about)

     1  package converters
     2  
     3  import (
     4  	"strconv"
     5  
     6  	"gitlab.com/evatix-go/core/constants"
     7  )
     8  
     9  func StringToIntegerDefault(
    10  	input string,
    11  ) int {
    12  	value, err2 := strconv.Atoi(input)
    13  
    14  	if err2 != nil {
    15  		return constants.Zero
    16  	}
    17  
    18  	return value
    19  }