Package convex.core.text
Class Text
java.lang.Object
convex.core.text.Text
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
columnCount
(String text) static String
dateFormat
(long timestamp) static boolean
isASCIIDigit
(char c) Return true if the character is an ASCII numeric digitstatic String
leftPad
(long value, int length) static String
static int
static String
repeat
(char c, int count) static String
rightPad
(long value, int length) static String
static String
toFriendlyBalance
(long balance) Format function for Convex Coin balancesstatic String
toFriendlyDecimal
(double value) static String
toFriendlyIntString
(double value) static String
toFriendlyNumber
(long value) static String
toPercentString
(double value) static String
whiteSpace
(int length) static void
writeEscapedByte
(BlobBuilder sb, byte b) Writes a UTF-8 byte, escaped as necessary for Java.static String
zeroPad
(BigInteger b, int digits) Zero pads a positive integer out to the specified number of digits
-
Constructor Details
-
Text
public Text()
-
-
Method Details
-
isASCIIDigit
public static boolean isASCIIDigit(char c) Return true if the character is an ASCII numeric digit- Parameters:
c
- Character to test- Returns:
- True if ASCII digit, false otherwise
-
whiteSpace
-
leftPad
-
leftPad
-
rightPad
-
rightPad
-
toFriendlyNumber
-
toPercentString
-
toFriendlyDecimal
-
toFriendlyIntString
-
toFriendlyBalance
Format function for Convex Coin balances- Parameters:
balance
- Balance in Convex Coins- Returns:
- Formatted String like "12.000567123"
-
dateFormat
-
writeEscapedByte
Writes a UTF-8 byte, escaped as necessary for Java. This works because only single byte ASCII characters need escaping.- Parameters:
sb
- BlobBuilder to append UTF-8 bytesb
- Byte to write
-
lineCount
-
columnCount
-
zeroPad
Zero pads a positive integer out to the specified number of digits- Parameters:
b
- Integer to paddigits
- Number of digits desired- Returns:
- String representation of Integer
-
repeat
-