Microsoft MakeCode

Can't use the percentage sign (%) inside a block's text


I am trying to create a block for humidity sensor,
I want the text on it to be: “humidity (%)”,
But the Makecode keep shows the wrong text…

namespace mysensor {
	 * get humidity as a relative percentage value.
	//% block="humidity (%)"
	export function humidity(): number {
		return sample.humidity;

I tried escaping the percentage sign (%) using:
“\uf295” (font awesome % icon)

But none of this works :frowning:
Looking forward for some help,

Here’s a block we have with it escaped properly: (the two slashes should be enough, the bar is just spacing)

1 Like

Yes the “\%” does the job!