Package growthbook.sdk.java.util
Class StringUtils
java.lang.Object
growthbook.sdk.java.util.StringUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic StringjsNumberToString(double value) Formats a number like JavaScript'sString(number)(ECMAScript Number::toString), so numeric operands compare like they do in the JS SDK.static Stringstatic StringpaddedVersionString(String input) static StringpadLeftZeros(String inputString, Integer length)
-
Method Details
-
normalize
-
isBlank
-
padLeftZeros
-
paddedVersionString
-
jsNumberToString
Formats a number like JavaScript'sString(number)(ECMAScript Number::toString), so numeric operands compare like they do in the JS SDK.Double.toString(double)can't be used: before JDK 19 it doesn't always give the shortest digits, and it uses a different notation.- Parameters:
value- the number to format- Returns:
- the shortest decimal digits that round-trip to
value, in plain notation unless the decimal exponent is 21 or more, or -7 or less (for example"1000","1.5","0.000002","1e+21","1e-7")
-