Skip to content

Number formatting #57

@ripienaar

Description

@ripienaar

I often have to graph bytes or large numbers. It would be helpful if I could pass a function in that can be used to format the number shown, something like:

		memPlot := asciigraph.Plot(memUsed,
			asciigraph.Caption("Memory Storage"),
			asciigraph.FormatValue(func(v float64) string {
						return humanize.IBytes(v)
			}),
			asciigraph.Width(width))

You'd call that when rendering the numbers

If you think this is a good idea I can try to contribute that, just wanted to sniff test the idea with you first @guptarohit

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions