Details
-
Type:
Sub-task
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.1.1
-
Fix Version/s: None
-
Component/s: Controllers
-
Labels:None
-
Environment:Windows 7 / Intellij 8.1.3 / Grails 1.1.1 / Chrome (in Belgium)
Description
Consider...
class DoubleCommand {
double d
}
public class TestController {
def home = { DoubleCommand d ->
render "$
"
}
}
apart from being pretty useless, this code produces following exciting result:
http://localhost:8080/<project>/test/home/1?d=1.23456 => 1.23456 (as expected)
http://localhost:8080/<project>/test/home/1?d=1.23456789 => 1.23456789E8 (hmm? that big?)
http://localhost:8080/<project>/test/home/1?d=1,23456789 => 1.23456789 (the comma as a decimal sign seems to do the trick?)
-
Hide
- doubleit.zip
- 20/May/13 9:27 AM
- 536 kB
- Jeff Brown
-
- doubleit/.classpath 1.0 kB
- doubleit/.gitignore 0.0 kB
- doubleit/.project 0.5 kB
- doubleit/application.properties 0.1 kB
- doubleit/.../ApplicationResources.groovy 0.1 kB
- doubleit/grails-app/.../BootStrap.groovy 0.1 kB
- doubleit/grails-app/.../BuildConfig.groovy 3 kB
- doubleit/grails-app/conf/Config.groovy 4 kB
- doubleit/grails-app/.../DataSource.groovy 1 kB
- doubleit/grails-app/.../UrlMappings.groovy 0.2 kB
- doubleit/grails-app/.../resources.groovy 0.0 kB
- doubleit/.../TestController.groovy 0.1 kB
- doubleit/grails-app/.../messages.properties 3 kB
- doubleit/.../messages_cs_CZ.properties 3 kB
- doubleit/.../messages_da.properties 3 kB
- doubleit/.../messages_de.properties 4 kB
- doubleit/.../messages_es.properties 3 kB
- doubleit/.../messages_fr.properties 2 kB
- doubleit/.../messages_it.properties 3 kB
- doubleit/.../messages_ja.properties 4 kB
- doubleit/.../messages_nb.properties 3 kB
- doubleit/.../messages_nl.properties 3 kB
- doubleit/.../messages_pl.properties 4 kB
- doubleit/.../messages_pt_BR.properties 3 kB
- doubleit/.../messages_pt_PT.properties 3 kB
- doubleit/.../messages_ru.properties 4 kB
- doubleit/.../messages_sv.properties 3 kB
- doubleit/.../messages_th.properties 6 kB
- doubleit/.../messages_zh_CN.properties 2 kB
- doubleit/grails-app/views/error.gsp 0.5 kB
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Hide
Vito Andolini
added a comment -
This is a pretty serious bug and was reported in 1.1.1. I just discovered it in 1.3.7, too. Is there any plan to fix it?
Show
Vito Andolini
added a comment - This is a pretty serious bug and was reported in 1.1.1. I just discovered it in 1.3.7, too. Is there any plan to fix it?
Hide
Jeff Brown
added a comment -
I am attaching a 2.3.0.M1 app. Can you please verify that this looks like it is working for you?
grails-app/controllers/com/demo/TestController.groovy
package com.demo class TestController { def home(DoubleCommand d) { render "${d.d}" } } class DoubleCommand { double d }
$ ./grailsw run-app | Server running. Browse to http://localhost:8080/doubleit
$ curl http://localhost:8080/doubleit/test/home?d=1.23456789 1.23456789
Show
Jeff Brown
added a comment - I am attaching a 2.3.0.M1 app. Can you please verify that this looks like it is working for you?
grails-app/controllers/com/demo/TestController.groovy
package com.demo
class TestController {
def home(DoubleCommand d) {
render "${d.d}"
}
}
class DoubleCommand {
double d
}
$ ./grailsw run-app
| Server running. Browse to http://localhost:8080/doubleit
$ curl http://localhost:8080/doubleit/test/home?d=1.23456789
1.23456789
Looking a bit deeper into the 1.1.1 source... It's probably a Locale / NumberFormat / CustomNumberEditor issue
ref. src/web/org/codehaus/groovy/grails/web/binding/GrailsDataBinder.java