Mercurial Hosting > luan
comparison src/luan/LuanJavaFunction.java @ 98:3a0ff21f0c96
fix LuanJavaFunction.ARG_FLOAT
git-svn-id: https://luan-java.googlecode.com/svn/trunk@99 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 22 Mar 2013 15:23:29 +0000 |
parents | 9aa7d5f20333 |
children | 2428ecfed375 |
comparison
equal
deleted
inserted
replaced
97:7b15f56660fa | 98:3a0ff21f0c96 |
---|---|
262 public Object convert(Object obj) { | 262 public Object convert(Object obj) { |
263 if( obj instanceof Float ) | 263 if( obj instanceof Float ) |
264 return obj; | 264 return obj; |
265 if( obj instanceof Number ) { | 265 if( obj instanceof Number ) { |
266 Number n = (Number)obj; | 266 Number n = (Number)obj; |
267 float r = n.floatValue(); | 267 return n.floatValue(); |
268 if( r==n.doubleValue() ) | |
269 return r; | |
270 } | 268 } |
271 if( obj instanceof String ) { | 269 if( obj instanceof String ) { |
272 String s = (String)obj; | 270 String s = (String)obj; |
273 try { | 271 try { |
274 return Float.valueOf(s); | 272 return Float.valueOf(s); |