# Lost of comma when convert string to number

**URL:** <https://forum.dynamobim.com/t/lost-of-comma-when-convert-string-to-number/8354>\
**Category:** Revit\
**Created:** [December 20, 2016, 10:08am UTC](https://forum.dynamobim.com/t/lost-of-comma-when-convert-string-to-number/8354 "2016-12-20T10:08:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![RVR](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@RVR](https://forum.dynamobim.com/u/RVR)\
**Post date:** [December 20, 2016, 10:08am UTC](https://forum.dynamobim.com/t/lost-of-comma-when-convert-string-to-number/8354/1 "2016-12-20T10:08:51Z")

</div>

Hi everyone.  
I work on my first project on dynamo.  
I try to import values to new share parameter, from Excel to Revit 2017.  
When I convert String of my list to number, I lost commas in the numbers…  
How can I conserve it ?

Thanks,  
All your topics help me everyday !

---

<div class="post-metadata">

**Author:** ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)\
**Post date:** [December 20, 2016, 10:23am UTC](https://forum.dynamobim.com/t/lost-of-comma-when-convert-string-to-number/8354/2 "2016-12-20T10:23:09Z")

</div>

Convert to text in Excel before importing it. The comma in numbers in Excel is a formatting option rather than a ‘real’ character

---

<div class="post-metadata">

**Author:** ![RVR](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@RVR](https://forum.dynamobim.com/u/RVR)\
**Post date:** [December 20, 2016, 10:30am UTC](https://forum.dynamobim.com/t/lost-of-comma-when-convert-string-to-number/8354/3 "2016-12-20T10:30:54Z")

</div>

Thank you for your answer. But it didn’t work…  
I try to cenvert (in excel) number/text/standar but no change…  
Any other ideas .?

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/b/0bd0cd253d40abae949398f41850895b6d11f16f.JPG)

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [December 20, 2016, 10:52am UTC](https://forum.dynamobim.com/t/lost-of-comma-when-convert-string-to-number/8354/4 "2016-12-20T10:52:50Z")

</div>

Not totally sure but I think I’ve solved this through the regional settings in Windows config’ (Region and Language / Additional settings)…

---

<div class="post-metadata">

**Author:** ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)\
**Post date:** [December 20, 2016, 11:03am UTC](https://forum.dynamobim.com/t/lost-of-comma-when-convert-string-to-number/8354/5 "2016-12-20T11:03:03Z")

</div>

As mentioned it’s a number formatting option in Excel. The only way to preserve the comma is to keep it as a string. Or check to see if Revit can store numbers with the same formatting as Excel (note that if you can, the comma obviously won’t appear/matter in Dynamo).

---

<div class="post-metadata">

**Author:** ![RVR](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@RVR](https://forum.dynamobim.com/u/RVR)\
**Post date:** [December 20, 2016, 11:11am UTC](https://forum.dynamobim.com/t/lost-of-comma-when-convert-string-to-number/8354/6 "2016-12-20T11:11:06Z")

</div>

yeah I try it too.  
But I just can replace “,” with “.”.  
But dynamo use alway “,” in his list system.

---

<div class="post-metadata">

**Author:** ![RVR](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@RVR](https://forum.dynamobim.com/u/RVR)\
**Post date:** [December 20, 2016, 11:13am UTC](https://forum.dynamobim.com/t/lost-of-comma-when-convert-string-to-number/8354/7 "2016-12-20T11:13:45Z")

</div>

Hum whatever the changment in Excel…  
It’s didn’t work with Dynamo.

Maybe I can put the comma after the conversion “String.ToNumber”.  
Something like nnnnn x 0.001 = nn,nnn.  
How can i try it ?

Thanks guys

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [December 20, 2016, 11:38am UTC](https://forum.dynamobim.com/t/lost-of-comma-when-convert-string-to-number/8354/8 "2016-12-20T11:38:32Z")

</div>

Just use _String.Split_ and then _String.Join_ 😌

---

<div class="post-metadata">

**Author:** ![RVR](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@RVR](https://forum.dynamobim.com/u/RVR)\
**Post date:** [December 20, 2016, 2:38pm UTC](https://forum.dynamobim.com/t/lost-of-comma-when-convert-string-to-number/8354/9 "2016-12-20T14:38:41Z")

</div>

hi,

Didn’t work too…  
I used a coef = 0.001 for create the decimal.

thank everybody

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [December 20, 2016, 2:41pm UTC](https://forum.dynamobim.com/t/lost-of-comma-when-convert-string-to-number/8354/10 "2016-12-20T14:41:44Z")

</div>

It works perfectly:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/7/676ca3914f99ab79f82cfcd8a5ed8755f3b53ba1.png)

---

<div class="post-metadata">

**Author:** ![Thomas3](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas3/32/102896_2.png) [@Thomas3](https://forum.dynamobim.com/u/Thomas3)\
**Post date:** [August 6, 2019, 8:25am UTC](https://forum.dynamobim.com/t/lost-of-comma-when-convert-string-to-number/8354/11 "2019-08-06T08:25:33Z")

</div>

@Yna_Db this is just a workaround for a bug in the String.ToNumber Node. IMO String.ToNumber should work with comma separated values as well.
