mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.9.3.1
This commit is contained in:
@@ -32,7 +32,7 @@ public class Xol_num_grp_fmtr {
|
||||
switch (b) {
|
||||
case Byte_ascii.Num_0: case Byte_ascii.Num_1: case Byte_ascii.Num_2: case Byte_ascii.Num_3: case Byte_ascii.Num_4:
|
||||
case Byte_ascii.Num_5: case Byte_ascii.Num_6: case Byte_ascii.Num_7: case Byte_ascii.Num_8: case Byte_ascii.Num_9: {
|
||||
int num_end = Bry_finder.Find_fwd_while_num(src, pos, src_len);
|
||||
int num_end = Bry_find_.Find_fwd_while_num(src, pos, src_len);
|
||||
int num_len = num_end - pos;
|
||||
if (num_len > grp_len) {
|
||||
if (!dirty) {
|
||||
@@ -49,7 +49,7 @@ public class Xol_num_grp_fmtr {
|
||||
break;
|
||||
}
|
||||
case Byte_ascii.Dot: {
|
||||
int num_end = Bry_finder.Find_fwd_while_num(src, pos + 1, src_len); // +1 to skip dot
|
||||
int num_end = Bry_find_.Find_fwd_while_num(src, pos + 1, src_len); // +1 to skip dot
|
||||
if (dirty)
|
||||
bfr.Add_mid(src, pos, num_end);
|
||||
pos = num_end;
|
||||
|
||||
@@ -26,13 +26,13 @@ class Xol_num_mgr__commafy_5 extends Xol_num_mgr { @Override public byte[] Comm
|
||||
b = num[++num_bgn]; // skip negative sign
|
||||
}
|
||||
if (Byte_ascii.Is_num(b)) { // check for preg_match( '/^-?\d{1,4}(\.\d+)?$/', $_ )
|
||||
int num_end = Bry_finder.Find_fwd_while_num(num, num_bgn, num_len);
|
||||
int num_end = Bry_find_.Find_fwd_while_num(num, num_bgn, num_len);
|
||||
if (num_end - num_bgn < 5) { // 1-4 digits
|
||||
if (num_end == num_len) return num; // no decimal; exit
|
||||
b = num[num_end];
|
||||
if ( b == Byte_ascii.Dot
|
||||
&& num_end != num_len - 1) { // if dot at end, then no match on above regx; fall-thru to below
|
||||
num_end = Bry_finder.Find_fwd_while_num(num, num_end + 1, num_len);
|
||||
num_end = Bry_find_.Find_fwd_while_num(num, num_end + 1, num_len);
|
||||
if (num_end == num_len) return num; // only numbers after dot; matches regx;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user