# Shape command not handled: e-4

**URL:** <https://discourse.processing.org/t/shape-command-not-handled-e-4/44894>\
**Category:** Coding Questions\
**Created:** [August 5, 2024, 7:48pm UTC](https://discourse.processing.org/t/shape-command-not-handled-e-4/44894 "2024-08-05T19:48:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ernest](https://avatars.discourse-cdn.com/v4/letter/e/c67d28/32.png) [@Ernest](https://discourse.processing.org/u/Ernest)\
**Post date:** [August 5, 2024, 7:48pm UTC](https://discourse.processing.org/t/shape-command-not-handled-e-4/44894/1 "2024-08-05T19:48:08Z")

</div>

Hey all,

Today I had a sketch like this:

```java
PShape s;

void setup() {
  size(400, 300);
  s = loadShape("shape.svg");
}

void draw() {
  background(255);
 shape(s);
}

```

And the Processing IDE tells me

> shape command not handled: e-4

I figured out what this means! It means that there is something in the XML of the SVG that Processing doesn’t like.

And what is that? It is `e-4`. It occurred in a string like this

```auto
-0.35022 -2.1e-4,-0.71185 0.14827

```

This may look like some SVG command or a problem with commas or white space, but is much simpler than that. It is a case of [Scientific\_notation](https://en.wikipedia.org/wiki/Scientific_notation). And Processing doesn’t like it.

This `-2.1e-4` should be this `-0.00021`. Do that and the error is gone.

How to convert scientific notation in Processing-friendly notation? Python and regex to the rescue!

```py
import re

def scientific_to_float(match):
    return str(float(match.group()))
pattern = r'\b\d+(\.\d+)?e-4\b'
with open('input.svg', 'r') as file:
    content = file.read()
updated_content = re.sub(pattern, scientific_to_float, content)
with open('output.svg', 'w') as file:
    file.write(updated_content)

```

Hope this helps!
