From 0a28da0ccbaea10ca9f70b08a2126e71fd26bf36 Mon Sep 17 00:00:00 2001 From: Wuppie007 Date: Thu, 17 Nov 2022 12:04:55 +0100 Subject: [PATCH] Update Text-with-numbers-are-getting-converted-to-numbers.md Update datetype --- Text-with-numbers-are-getting-converted-to-numbers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Text-with-numbers-are-getting-converted-to-numbers.md b/Text-with-numbers-are-getting-converted-to-numbers.md index 0744aef..a2f3d24 100644 --- a/Text-with-numbers-are-getting-converted-to-numbers.md +++ b/Text-with-numbers-are-getting-converted-to-numbers.md @@ -4,7 +4,7 @@ To insert a number as text you have the following options: 1. Use an apostrophe: `cell.Value = "**'**123"`; 2. Use SetValue: `cell.SetValue("123"); // SetValue will not try to convert to the appropriate type.` -3. Change the cell's data type to text after it has the numeric value: `cell.SetValue(123).SetDataType(XLCellValues.Text);` +3. Change the cell's data type to text after it has the numeric value: `cell.SetValue(123).SetDataType(XLDataType.Text);` 4. Set the cell's format to "@" before setting the value: `cell.Style.NumberFormat.Format = "@"; cell.Value = "123";` For more information see [Data Types](Data-Types)