How can i convert sytemdouble to string

i need to know how can i convert sytemdouble to string because i need to write it in a excel file and compare the number with an other one

Convert.ToString(YourSystemDoubleVariable)

Hi @Soudios

You can try any of these

yourvariable.ToString
or
convert.ToString(yourvariable)

Regards

image

@Rohan_Ashok_Gaikwad @vrdabberu
i have this many zero at the end, how can i have only 2 after the decimal ?

image

Hey @Soudios
You can use:
newString = doubleValue.ToString("F2")

image

Hi @Soudios

yourvariable.ToString("F2")

In the above syntax the F2 means it will take the 2 values after the decimal. So how many values you need to get after the decimal then please indicate that number instead of 2.

Regards

why are you using “F” ?

Its not working

image

Hi @Soudios

What is the data type of out_marginexcel variable?

Regards

string

Hi @Soudios

Try giving the syntax as cell.ToString("F2")

Regards

ok its working but i need to compare this value with an other one,

but in the second value i can’t remove the space
the variable is on string format

image

Hi @Soudios

Could you please confirm whether you have used the below syntax in value to assign or not.

Yourvariable.ToString.Replace(" ","")

Regards

no i didn’t try with this syntax before, i just did it now and its not working too

Hi @Soudios

Can you please confirm what syntax you have tried to remove space and what is the variable you have given?

Regards

i tried :

Yourvariable.ToString.Replace(" “,”")

 and 

Yourvariable.Replace(" ","")

Hi @Soudios

The images didn’t got uploaded properly and also what you have given in the place of yourvariable?

Regards

@Soudios

What is the value given in Save To and value to Save. Can you specify.

Regards

oh i thought you read all the conversation :slight_smile:

the value is : 245 664,20