All checks were successful
Build and push image / deploy (push) Successful in 1m44s
27 lines
481 B
Go
27 lines
481 B
Go
package plati
|
|
|
|
import (
|
|
"encoding/xml"
|
|
"strconv"
|
|
"strings"
|
|
)
|
|
|
|
type Stupidfloat float64
|
|
|
|
func (f Stupidfloat) Float64() float64 {
|
|
return float64(f)
|
|
}
|
|
|
|
func (f *Stupidfloat) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
|
floatString := ""
|
|
err := d.DecodeElement(&floatString, &start)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
floatString = strings.ReplaceAll(floatString, ",", ".")
|
|
fl64, err := strconv.ParseFloat(floatString, 64)
|
|
|
|
*f = Stupidfloat(fl64)
|
|
return nil
|
|
}
|