Finishes the numeric token, removing trailing zeroes. @param token token to be modified @return token
(final byte[] token)
| 522 | * @return token |
| 523 | */ |
| 524 | public static byte[] chopNumber(final byte[] token) { |
| 525 | if(!contains(token, '.') || contains(token, 'e') || contains(token, 'E')) return token; |
| 526 | // remove trailing zeroes |
| 527 | int tl = token.length; |
| 528 | while(--tl > 0 && token[tl] == '0'); |
| 529 | return substring(token, 0, token[tl] == '.' ? tl : tl + 1); |
| 530 | } |
| 531 | |
| 532 | /** Constant float values. */ |
| 533 | private static final float[] FLT = { 1.0E17f, 1.0E15f, 1.0E13f, 1.0E11f, |