diff --git a/nativescript-core/ui/text-base/span.ts b/nativescript-core/ui/text-base/span.ts index e2a648a34..afce37d80 100644 --- a/nativescript-core/ui/text-base/span.ts +++ b/nativescript-core/ui/text-base/span.ts @@ -65,8 +65,9 @@ export class Span extends ViewBase implements SpanDefinition { } set text(value: string) { if (this._text !== value) { - this._text = value && value.replace("\\n", "\n").replace("\\t", "\t"); - this.notifyPropertyChange("text", value); + // value can be a number + this._text = `${value}`.replace("\\n", "\n").replace("\\t", "\t"); + this.notifyPropertyChange("text", this._text); } }