Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number formatting #57

Open
ripienaar opened this issue Sep 25, 2024 · 3 comments · May be fixed by #58
Open

Number formatting #57

ripienaar opened this issue Sep 25, 2024 · 3 comments · May be fixed by #58
Labels
enhancement New feature or request

Comments

@ripienaar
Copy link

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

@ripienaar
Copy link
Author

Something like #58

@guptarohit
Copy link
Owner

@ripienaar Thank you for bringing up this interesting use case and for submitting a pull request to address it. I'll review and merge it as soon as possible.

@guptarohit guptarohit added the enhancement New feature or request label Oct 11, 2024
@guptarohit guptarohit linked a pull request Oct 11, 2024 that will close this issue
@ripienaar
Copy link
Author

@guptarohit unfortunately the associated PR got stale as you did not review it.

If I update the PR will you review it? Or perhaps review it as it stands and I will update it for main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants