We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Question around setting a cell value

Thread ID:

Created:

Updated:

Platform:

Replies:

35870 Oct 12,2005 01:01 PM UTC Oct 13,2005 12:35 PM UTC Windows Forms 1
loading
Tags: XlsIO
Luke
Asked On October 12, 2005 01:01 PM UTC

Hi, I have a decimal number stored in a string. I want to assign this value to a cell, but I do not want to convert it from string to decimal before setting the cells'' IRange.Value2 property. For example: string mynumber = "20.18"; IRange myRange = sheet.Range[1,1]; myRange.Value2 = mynumber myRange.NumberFormat = "0.00"; Will this display the number as 20.18, and will Excel recognise this value as a Decimal instead of a string? Thanks, Luke.

Administrator [Syncfusion]
Replied On October 13, 2005 12:35 PM UTC

Hi Luke, This code will display the number as 20.18 and when the number format is given as "0.00" , excel will recognize this value as decimal. Best Regards, Seetha >Hi, > >I have a decimal number stored in a string. I want to assign this value to a cell, but I do not want to convert it from string to decimal before setting the cells'' IRange.Value2 property. > >For example: >string mynumber = "20.18"; >IRange myRange = sheet.Range[1,1]; >myRange.Value2 = mynumber >myRange.NumberFormat = "0.00"; > >Will this display the number as 20.18, and will Excel recognise this value as a Decimal instead of a string? > >Thanks, >Luke.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;