# Convert scientific notation string to number

**URL:** <https://forum.dynamobim.com/t/convert-scientific-notation-string-to-number/48973>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [April 7, 2020, 2:09am UTC](https://forum.dynamobim.com/t/convert-scientific-notation-string-to-number/48973 "2020-04-07T02:09:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cui0801](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@cui0801](https://forum.dynamobim.com/u/cui0801)\
**Post date:** [April 7, 2020, 2:09am UTC](https://forum.dynamobim.com/t/convert-scientific-notation-string-to-number/48973/1 "2020-04-07T02:09:26Z")

</div>

![捕获](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/2/a21011860bec48860dce2f747f018816e235f5cd.jpeg)  
Hi guys, I am a beginner of Dynamo and python, how can I convert scientific notation string to number? I used string to number, but it can not recognize the scientific notation.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [April 7, 2020, 9:32am UTC](https://forum.dynamobim.com/t/convert-scientific-notation-string-to-number/48973/2 "2020-04-07T09:32:35Z")

</div>

String.Split to split the numbers at the E.  
String.ToNumber to convert the strings to numbers.  
List.FetItemAtIndex to get the powers. Longest lacing here.  
Math.Pow to raise 10 to the powers pulled in step two.  
List.First to pull the first numbers from the list. Longest lacing here too.  
Multiply the the firsts by the results of the Math.Pow node.

You will likely see some warnings (not errors) because not all values have an E so the string may not always split and there may not be any items at index 2, so check your data sets carefully.

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [April 7, 2020, 11:38am UTC](https://forum.dynamobim.com/t/convert-scientific-notation-string-to-number/48973/3 "2020-04-07T11:38:14Z")

</div>

hello,  
you can use the [float()](https://docs.python.org/2.7/library/functions.html#float) Python function

 ![float_function](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/1/51615612735c8df3707c9a793abbefa3e4ed8064.png)

```
input = IN[0]
if not hasattr(input, " __iter__"):
	input = [input]

OUT = [float(x) for x in input]
```

---

<div class="post-metadata">

**Author:** ![cui0801](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@cui0801](https://forum.dynamobim.com/u/cui0801)\
**Post date:** [April 8, 2020, 6:41am UTC](https://forum.dynamobim.com/t/convert-scientific-notation-string-to-number/48973/4 "2020-04-08T06:41:55Z")

</div>

Thank you guys!

---

<div class="post-metadata">

**Author:** ![Andrew\_Hannell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andrew_hannell/32/103315_2.png) [@Andrew\_Hannell](https://forum.dynamobim.com/u/Andrew_Hannell)\
**Post date:** [April 8, 2020, 7:40am UTC](https://forum.dynamobim.com/t/convert-scientific-notation-string-to-number/48973/5 "2020-04-08T07:40:37Z")

</div>

@cui0801

where is the data coming from ? It’s probably easier to address the root cause, rather than converting strings to other data types

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/1/41226f438776ead06675a1088c1234be56081100.png)
