| 174 | } |
| 175 | |
| 176 | public TimeString round(int precision) { |
| 177 | checkArgument(precision >= 0); |
| 178 | int targetLength = 9 + precision; |
| 179 | if (v.length() <= targetLength) { |
| 180 | return this; |
| 181 | } |
| 182 | String v = this.v.substring(0, targetLength); |
| 183 | while (v.length() >= 9 && (v.endsWith("0") || v.endsWith("."))) { |
| 184 | v = v.substring(0, v.length() - 1); |
| 185 | } |
| 186 | return new TimeString(v); |
| 187 | } |
| 188 | public int getMillisOfDay() { |
| 189 | int h = Integer.valueOf(v.substring(0, 2)); |
| 190 | int m = Integer.valueOf(v.substring(3, 5)); |