Class StringUtils
java.lang.Object
org.flag4j.util.StringUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringCenters a string within a specified size bin.static StringCenters a string within a specified size bin.static StringValueOfRound(double value, int precision) Gets the string representation of a double rounded to the specified precision.static <T> StringValueOfRound(T value, int precision) Gets the string representation of a field element rounded to the specified precision if possible.
-
Method Details
-
center
-
center
Centers a string within a specified size bin.- Parameters:
s- String to center.size- Size of the bin to center string within.pad- Padding character.- Returns:
- A string made up of the padding character of specified size with the string s centered within it.
-
ValueOfRound
Gets the string representation of a double rounded to the specified precision.- Parameters:
value- Value to convert to String.precision- Precision to round value to.- Returns:
- The string representation of a double rounded to the specified precision.
-
ValueOfRound
Gets the string representation of a field element rounded to the specified precision if possible.- Parameters:
value- Value to convert to String.precision- Precision to round value to if the value can be rounded.- Returns:
- The string representation of
valuerounded to the specified precision if the field type can be rounded.
-