Added a format method for floats.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1477 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
package com.samskivert.velocity;
|
package com.samskivert.velocity;
|
||||||
|
|
||||||
|
import java.text.NumberFormat;
|
||||||
|
|
||||||
import com.samskivert.servlet.util.HTMLUtil;
|
import com.samskivert.servlet.util.HTMLUtil;
|
||||||
import com.samskivert.util.StringUtil;
|
import com.samskivert.util.StringUtil;
|
||||||
|
|
||||||
@@ -67,4 +69,12 @@ public class StringTool
|
|||||||
{
|
{
|
||||||
return HTMLUtil.makeParagraphs(text);
|
return HTMLUtil.makeParagraphs(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a float to a reasonably formatted string.
|
||||||
|
*/
|
||||||
|
public static String format(float value)
|
||||||
|
{
|
||||||
|
return NumberFormat.getInstance().format(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user