jqplot Pie Chart data label format precision without trailing zeros
问题 I would like to know how to format the data labels on a Pie Chart so it shows max 2 decimal characters, and never shows trailing zeros , for example: 2 -> 2 2.0 -> 2 2.566 -> 2.57 In other words, I am asking how to set dataLabelFormatString parameter ? I know it is using sprintf , thus I tried '%.2f' and '%g'. They do not solved my problem though. Since the first makes each number to show to decimal characters, the other just removes trailing zeros but doesn't work with precision as in this