commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Carman <ja...@carmanconsulting.com>
Subject Re: [LANG] support for k, M suffices when parsing numbers
Date Thu, 02 Jun 2011 14:50:43 GMT
On Thu, Jun 2, 2011 at 10:31 AM, Matt Benson <gudnabrsam@gmail.com> wrote:
> FWIW, this type of code lives in Ant as long
> org.apache.tools.ant.util.StringUtils#parseHumanSizes(String).  IMO it
> would be fine to copy/adapt this method into lang3 in perhaps
> StringUtils or NumberUtils.  No harm in creating MemUtils as James
> suggested, but unless we can think of other things to go there I don't
> know if it can be justified.
>

I would also suggest a method that takes a long and spits out a string
with the biggest denomination (kb, mb, gb, etc.) it can find to
display it.

If it doesn't go in its own class, where else would you put it?
Perhaps StringUtils or NumberUtils?  Maybe even SystemUtils, since
there are memory-related methods in System?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message