last commit tuning
This commit is contained in:
@@ -1668,13 +1668,13 @@ double Graphic::splitRangeDate(double range, int count, const char *& up_format,
|
||||
};
|
||||
double ret = splitRange(range, count);
|
||||
int format_index = 6;
|
||||
if (ret < to_sec / 3) {format_index = 0; step[0] = qRound64(ret);}
|
||||
else if (ret < to_min / 2) {format_index = 1; step[1] = roundToNearest(ret / to_sec , {1, 2, 5, 10, 15, 20, 30});}
|
||||
else if (ret < to_hour / 2) {format_index = 2; step[2] = roundToNearest(ret / to_min , {1, 2, 5, 10, 15, 20, 30});}
|
||||
else if (ret < to_day / 2) {format_index = 3; step[3] = roundToNearest(ret / to_hour , {1, 2, 3, 4, 6, 8, 12});}
|
||||
else if (ret < to_month ) {format_index = 4; step[4] = roundToNearest(ret / to_day , {1, 2, 5, 10});}
|
||||
else if (ret < to_year ) {format_index = 5; step[5] = roundToNearest(ret / to_month, {1, 2, 3, 4, 6});}
|
||||
else {format_index = 6; step[6] = qRound64(ret);}
|
||||
if (ret < to_sec / 3 ) {format_index = 0; step[0] = qRound64(ret);}
|
||||
else if (ret < to_min / 2 ) {format_index = 1; step[1] = roundToNearest(ret / to_sec , {1, 2, 5, 10, 15, 20, 30});}
|
||||
else if (ret < to_hour / 2 ) {format_index = 2; step[2] = roundToNearest(ret / to_min , {1, 2, 5, 10, 15, 20, 30});}
|
||||
else if (ret < to_day / 2 ) {format_index = 3; step[3] = roundToNearest(ret / to_hour , {1, 2, 3, 4, 6, 8, 12});}
|
||||
else if (ret < to_month / 1.5) {format_index = 4; step[4] = roundToNearest(ret / to_day , {1, 2, 5, 10});}
|
||||
else if (ret < to_year ) {format_index = 5; step[5] = roundToNearest(ret / to_month, {1, 2, 3, 4, 6});}
|
||||
else {format_index = 6; step[6] = qRound64(ret);}
|
||||
up_format = formats[format_index].upper;
|
||||
lo_format = formats[format_index].lower;
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user