2025-06-19 16:22:55 +03:00
|
|
|
package command
|
2025-06-18 17:04:06 +03:00
|
|
|
|
|
|
|
import "strconv"
|
|
|
|
|
|
|
|
type Parameter struct {
|
|
|
|
value string
|
|
|
|
}
|
|
|
|
|
|
|
|
func CreateParameter(value string) Parameter {
|
|
|
|
return Parameter{
|
|
|
|
value: value,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p Parameter) AsString() (res string, err error) {
|
|
|
|
return p.value, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p Parameter) AsInteger() (res int, err error) {
|
|
|
|
return strconv.Atoi(p.value)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p Parameter) AsDecimal() (res float64, err error) {
|
|
|
|
return strconv.ParseFloat(p.value, 32)
|
|
|
|
}
|