* Non Scientific: "%.3lf", scale=1.00
* Scientific: "%.2lfe3", scale = 0.001
* Usage example:
- * fs = chart_get_ticks_format(95359943.3,34434.9,8,&scale,&long);
+ * fs = chart_get_ticks_format(95359943.3,34434.9,8,&scale);
* printf(fs,value*scale);
* free(fs);
*/
}
else if (logmax > 0.0) /*logintv is > 0*/
{
- if (logintv < 3.0)
+ if (logintv < 5.0)
{
logshift = 0; /* No scientific format */
nrdecs = 0;
{
logshift = (int)logmax;
nrdecs = MIN(6,(int)(logmax-logintv)+1);
- format_string = xasprintf("%%.%dlfe%d",nrdecs,logshift);
+ format_string = xasprintf("%%.%dlf∙10<sup>%d</sup>",nrdecs,logshift);
}
}
else /* logmax and logintv are < 0 */
{
- if (logmax > -3.0)
+ if (logmax > -4.0)
{
logshift = 0; /* No scientific format */
nrdecs = (int)(-logintv) + 1;
{
logshift = (int)logmax-1;
nrdecs = MIN(6,(int)(logmax-logintv)+1);
- format_string = xasprintf("%%.%dlfe%d",nrdecs,logshift);
+ format_string = xasprintf("%%.%dlf∙10<sup>%d</sup>",nrdecs,logshift);
}
}
*scale = pow(10.0,-(double)logshift);
AT_CHECK([../../math/chart-get-ticks-format-test], [0], [dnl
max: 1000, min: 10, nticks: 10, fs: %.0lf, scale: 1, example: 505
max: 10000, min: 10, nticks: 10, fs: %.0lf, scale: 1, example: 5005
-max: 100000, min: 10, nticks: 10, fs: %.2lfe5, scale: 1e-05, example: 0.50e5
-max: 1e+06, min: 10, nticks: 10, fs: %.2lfe6, scale: 1e-06, example: 0.50e6
-max: 1e+07, min: 10, nticks: 10, fs: %.2lfe7, scale: 1e-07, example: 0.50e7
-max: 1e+08, min: 10, nticks: 10, fs: %.2lfe8, scale: 1e-08, example: 0.50e8
+max: 100000, min: 10, nticks: 10, fs: %.0lf, scale: 1, example: 50005
+max: 1e+06, min: 10, nticks: 10, fs: %.0lf, scale: 1, example: 500005
+max: 1e+07, min: 10, nticks: 10, fs: %.2lf∙10<sup>7</sup>, scale: 1e-07, example: 0.50∙10<sup>7</sup>
+max: 1e+08, min: 10, nticks: 10, fs: %.2lf∙10<sup>8</sup>, scale: 1e-08, example: 0.50∙10<sup>8</sup>
max: 0.1, min: 0.01, nticks: 10, fs: %.3lf, scale: 1, example: 0.055
-max: 1e-05, min: 1e-06, nticks: 10, fs: %.2lfe-6, scale: 1e+06, example: 5.50e-6
-max: 1.00001e-05, min: 1e-05, nticks: 10, fs: %.6lfe-5, scale: 100000, example: 1.000005e-5
+max: 0.01, min: 0.001, nticks: 10, fs: %.4lf, scale: 1, example: 0.0055
+max: 0.001, min: 0.0001, nticks: 10, fs: %.5lf, scale: 1, example: 0.00055
+max: 0.0001, min: 1e-05, nticks: 10, fs: %.2lf∙10<sup>-5</sup>, scale: 100000, example: 5.50∙10<sup>-5</sup>
+max: 1e-05, min: 1e-07, nticks: 10, fs: %.2lf∙10<sup>-6</sup>, scale: 1e+06, example: 5.05∙10<sup>-6</sup>
+max: 1e-07, min: 1e-08, nticks: 10, fs: %.2lf∙10<sup>-8</sup>, scale: 1e+08, example: 5.50∙10<sup>-8</sup>
+max: 1.00001e-05, min: 1e-05, nticks: 10, fs: %.6lf∙10<sup>-5</sup>, scale: 100000, example: 1.000005∙10<sup>-5</sup>
max: 1e+08, min: 1e+08, nticks: 10, fs: %.0lf, scale: 1, example: 100000005
-max: 100000, min: -500000, nticks: 10, fs: %.1lfe5, scale: 1e-05, example: -2.0e5
+max: 100000, min: -500000, nticks: 10, fs: %.0lf, scale: 1, example: -200000
max: 5, min: -5, nticks: 10, fs: %.0lf, scale: 1, example: 0
max: 5, min: -4.999, nticks: 10, fs: %.1lf, scale: 1, example: 0.0
max: 5, min: -4.999, nticks: 9, fs: %.0lf, scale: 1, example: 0
max: 5, min: 0, nticks: 10, fs: %.1lf, scale: 1, example: 2.5
max: 0, min: -5, nticks: 9, fs: %.1lf, scale: 1, example: -2.5
-max: 1.001e-95, min: 1e-95, nticks: 10, fs: %.5lfe-95, scale: 1e+95, example: 1.00050e-95
-max: 1.001e+98, min: 1e+98, nticks: 10, fs: %.5lfe98, scale: 1e-98, example: 1.00050e98
-max: 1.001e+33, min: 1e-22, nticks: 10, fs: %.2lfe33, scale: 1e-33, example: 0.50e33
+max: 1.001e-95, min: 1e-95, nticks: 10, fs: %.5lf∙10<sup>-95</sup>, scale: 1e+95, example: 1.00050∙10<sup>-95</sup>
+max: 1.001e+98, min: 1e+98, nticks: 10, fs: %.5lf∙10<sup>98</sup>, scale: 1e-98, example: 1.00050∙10<sup>98</sup>
+max: 1.001e+33, min: 1e-22, nticks: 10, fs: %.2lf∙10<sup>33</sup>, scale: 1e-33, example: 0.50∙10<sup>33</sup>
])
AT_CLEANUP