Skip to content

Dirty Parsing: String to Integers #12

@amberpixels

Description

@amberpixels

add in configuration flag if we can round floats?
We already have RoundingAlg but the difference here is that we should choose weather it will be red/yellow result

	// should be a regular integer value.

	// Parse the float.
	// TODO: configurable: if we allow to "round" floats??
	n, err := strconv.ParseInt(strings.TrimSpace(string(data)), 10, 64)
	if err != nil {
		return fmt.Errorf("dirty.Integer: cannot parse number: %w", err)
	}
	*v = Integer(n)
	return nil

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions