ninetwozero / gradle-to-js

A quick & dirty Gradle build file to JavaScript object parser
Apache License 2.0
47 stars 21 forks source link

Prevent losing floating point definitions #1

Closed geof90 closed 8 years ago

geof90 commented 8 years ago

JavaScript numbers do not distinguish between ints and floats, hence a number like 1.0 defined in Gradle would get parsed to 1 in JavaScript. From a practical standpoint, this is a problem if we use it in Android projects where we try to parse an app version string like "1.0" - after parsing, we would have no way to tell whether the version was defined with both a major and minor version. Pending a better solution, we should just provide everything as strings to JavaScript, and let the user decide his own number conversion scheme if needed.

geof90 commented 8 years ago

@karllindmark sure! Thanks for building this project btw! It's been immensely helpful!

karllindmark commented 8 years ago

Happy to hear that @geof90, and thanks for contributing your improvements back into the main repo. :))