func StringPriceToFloat(price string) (float64, string, error) {
	price = strings.TrimSpace(price)

	if price == "" {
		return 0, "", nil
	}

	var currency string
	var number string

	for _, char := range price {
		if char == ' ' || char == '+' {
			continue
		} else if char == '.' || char == ',' {
			number += "."
		} else if unicode.IsDigit(char) {
			number += string(char)
		} else {
			currency += string(char)
		}
	}

	float, err := strconv.ParseFloat(number, 64)

	if err != nil {
		return 0, "", err
	}

	return float, currency, nil
}
// Converts a string representation of a into a float and a string representing the currency.
Converts a string representation of a into a float and a string representing the currency.
// Converts a string representation of a into a float and a string representing the currency .
func StringPriceToFloat(price string) (float64, string, error) {
	price = strings.TrimSpace(price)
	if price == "" {
		return 0, "", nil
	}
	var currency string
	var number string
	for _, char := range price {
		if char == ' ' || char == '+' {
			continue
		} else if char == '.' || char == ',' {
			number += "."
		} else if unicode.IsDigit(char) {
			number += string(char)
		} else {
			currency += string(char)
		}
	}
	float, err := strconv.ParseFloat(number, 64)
	if err != nil {
		return 0, "", err
	}
	return float, currency, nil
}
func StringPriceToFloat ( price string ) ( float64 , string , error ) { price = strings . TrimSpace ( price ) if price == " " { return 0 , " " , nil } var currency string var number string for _ , char := range price { if char == ' ' || char == '+' { continue } else if char == '.' || char == ',' { number += " " } else if unicode . IsDigit ( char ) { number += string ( char ) } else { currency += string ( char ) } } float , err := strconv . ParseFloat ( number , 64 ) if err != nil { return 0 , " " , err } return float , currency , nil }
Converts a string representation of a into a float and a string representing the currency.
Converts a string representation of a into a float and a string representing the currency .