mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 11:52:08 +08:00
增加float转integer方法
This commit is contained in:
@@ -389,4 +389,16 @@ public class ConvertUtil {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Integer float2Integer(Float f) {
|
||||||
|
if (null == f) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return f.intValue();
|
||||||
|
} catch (Exception e) {
|
||||||
|
// ignore exception
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user