- Mac Sierra 10.12.2
- Eclipse Neon.2 (4.6.2)
- ConnectIQ SDK 2.2.4 -- Plugins 2.2.3
Detailed Description:
When trying to use
"°C" or "°F"
in the pattern string of a Lang.format() statement, you only see the "°" symbol and not the "C" or "F" as well.
If you put a character like a whitespace after the "C" or "F" as follows
"°C " or "°F "
then you see the expected correct result.
Happens in the simulator.
Steps to reproduce:
- Create a watch face project
- Add two labels, Label1 and Label2 to the layout
- Copy and paste the code snippet below to replace the onUpdate() method
- Run
- Observe that for 25 degrees Celsius, only the "°" symbol displays, and for 30 degrees Celsius, both the "°" symbol and the letter "C" displays.
Code sample:
function onUpdate(dc) {
var lbl1 = View.findDrawableById("Label1");
lbl1.setText(Lang.format("$1$ °C",[25]));
var lbl2 = View.findDrawableById("Label2");
lbl2.setText(Lang.format("$1$ °C ",[30])); //note the whitespace after "C"
View.onUpdate(dc);
}