add parsing sumpays
All checks were successful
Build and push image / deploy (push) Successful in 1m44s

This commit is contained in:
2023-12-27 00:15:55 +03:00
parent c60045c47b
commit 3bbc6a0baa
9 changed files with 308 additions and 42 deletions

26
plati/stupidfloat.go Normal file
View File

@ -0,0 +1,26 @@
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
}