# Sparql: Convert xsd:double (with exponent) to xsd:decimal

**URL:** <https://community.stardog.com/t/sparql-convert-xsd-double-with-exponent-to-xsd-decimal/4121>\
**Category:** Bug\
**Created:** [December 2, 2022, 8:56am UTC](https://community.stardog.com/t/sparql-convert-xsd-double-with-exponent-to-xsd-decimal/4121 "2022-12-02T08:56:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mopitz](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@mopitz](https://community.stardog.com/u/mopitz)\
**Post date:** [December 2, 2022, 8:56am UTC](https://community.stardog.com/t/sparql-convert-xsd-double-with-exponent-to-xsd-decimal/4121/1 "2022-12-02T08:56:27Z")

</div>

Hi,

When converting a `xsd:double` to `xsd:decimal`, the `xsd:decimal` value keeps the E notation (which seems invalid : [XML Schema Part 2: Datatypes Second Edition](https://www.w3.org/TR/xmlschema-2/#decimal) )

Is this a bug?  
And does someone if there’s a workaround?

Query:

```auto
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT * WHERE {
  BIND( "1.62608E7"^^xsd:double AS ?value_double ) .
  BIND( xsd:decimal(?value_double) AS ?value_decimal ) .
}

```

returns:  
?value\_double: "1.62608E7"^^xsd:double  
?value\_decimal: "1.62608E7"^^xsd:decimal

Update: Forgot to mention the Stardog Version:  
Stardog Server Version: 7.9.1

Regards  
Michael

---

<div class="post-metadata">

**Author:** ![Lars\_Heling](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/lars_heling/32/1657_2.png) [@Lars\_Heling](https://community.stardog.com/u/Lars_Heling)\
**Post date:** [December 2, 2022, 4:23pm UTC](https://community.stardog.com/t/sparql-convert-xsd-double-with-exponent-to-xsd-decimal/4121/2 "2022-12-02T16:23:58Z")

</div>

Hi Michael,

This looks like a bug. I created a ticket for it: [PLAT-5145].

Thanks,  
Lars
