RMLio / rmlmapper-java

The RMLMapper executes RML rules to generate high quality Linked Data from multiple originally (semi-)structured data sources
http://rml.io
MIT License
144 stars 61 forks source link

Bug when dealing with Double numbers from RDBs #206

Closed julianrojas87 closed 1 year ago

julianrojas87 commented 1 year ago

The condition used within this function to remove trailing decimal points .0 is affecting proper double numbers. For example, 19.045 becomes 1945.

The solution is simply checking if the number actually ends with .0 to perform the transformation:

if (DOUBLE.equals(dataType) && data.endsWith(".0")) {
   // remove trailing decimal points (Quirk from MySQL, see issue 203)
   return data.replace(".0", "");
}
ghsnd commented 1 year ago

Fixed on development branch

DylanVanAssche commented 1 year ago

Fixed in 950a77cb8f2a9254cf387cf3b6bbdca778fb49fb