// for usec we shall not use: ((long) floatValue * 1000000) % 1000
// if ( usec >= 0 ) timestamp.setNanos( timestamp.getNanos() + usec * 1000 );
// due doubles inaccurate precision it's better to parse to_s :
final ByteList strValue = ((RubyString) value.to_s()).getByteList();
final int dot1 = strValue.lastIndexOf('.') + 1, dot4 = dot1 + 3;
final int len = strValue.getRealSize() - strValue.getBegin();
if ( dot1 > 0 && dot4 < len ) { // skip .123 but handle .1234
final int end = Math.min( len - dot4, 3 );
CharSequence usecSeq = strValue.subSequence(dot4, end);
final int usec = Integer.parseInt( usecSeq.toString() );