|
@@ -1,6 +1,9 @@
|
|
|
package formatutil
|
|
package formatutil
|
|
|
|
|
|
|
|
-import "math"
|
|
|
|
|
|
|
+import (
|
|
|
|
|
+ "math"
|
|
|
|
|
+ "strings"
|
|
|
|
|
+)
|
|
|
|
|
|
|
|
func Float64ToResponse(f float64) *float64 {
|
|
func Float64ToResponse(f float64) *float64 {
|
|
|
if math.IsNaN(f) || math.IsInf(f, 0) {
|
|
if math.IsNaN(f) || math.IsInf(f, 0) {
|
|
@@ -9,3 +12,7 @@ func Float64ToResponse(f float64) *float64 {
|
|
|
|
|
|
|
|
return &f
|
|
return &f
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+func StripWhitespace(s string) string {
|
|
|
|
|
+ return strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(s, " ", ""), "\t", ""), "\n", "")
|
|
|
|
|
+}
|