Microsoft MakeCode

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

Hi

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:
“%%”
“%”
“\u0025”
“\uf295” (font awesome % icon)
image

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

Here’s a block we have with it escaped properly: https://github.com/microsoft/pxt-common-packages/blob/ee347224faa9135b57017bbf68bf8859c616ed1d/libs/game/mathUtil.ts#L7 (the two slashes should be enough, the bar is just spacing)

1 Like

Thanks!
Yes the “\%” does the job!