Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo format string puts literal '?' in the wrong place

We allow users to specify custom symbols as part of the number formats they see in our software. We are using Kendo's formatting capability to incorporate these symbols as part of our format strings. For example, we might have a format string like:

var format = "\\$0.00\\/\\h\\r;(\\$0.00\\/\\h\\r)";
kendo.toString(-1.7, format); // ($1.70/hr)

Note the use of backslashes to escape literal characters in the format string. This seems to work well, except when the ? character is used. Here's an example:

var format = "\\?\\x0";
kendo.toString(100, format); // returns "x?100", but I would expect "?x100"

What's going on here? Is this a bug in Kendo or desired behavior?

like image 803
ChaseMedallion Avatar asked Oct 11 '16 13:10

ChaseMedallion


1 Answers

If anyone stumbles across this question, there's a discussion about it in the Telerik forums which I assume the OP opened. This led to opening an issue on github.


[Edit:]
The github bug was opened with this information:

Bug report
Kendo format string does not put the literal '?' in the correct place. This is not observable in every scenario. Escaping or not the literal '?' does not change the result is some scenarios.

Reproduction of the problem
The issue can be observed in the following Dojo: http://dojo.telerik.com/avUne

Environment
Browser: all

There was no update since 18 Oct 2016, up to the time these words have been typed.

like image 59
Shai Avatar answered Nov 17 '22 05:11

Shai