FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
jruby/core/src/main/java/org/jruby/util/SafeDecimalParser.java at master · jruby/jruby · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
jruby
/
jruby
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
946
Star
3.9k
Code
Issues
840
Pull requests
109
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
jruby
/
core
/
src
/
main
/
java
/
org
/
jruby
/
util
/
SafeDecimalParser.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (38 loc) · 1.13 KB
Breadcrumbs
jruby
/
core
/
src
/
main
/
java
/
org
/
jruby
/
util
/
SafeDecimalParser.java
Copy path
File metadata and controls
42 lines (38 loc) · 1.13 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package
org
.
jruby
.
util
;
import
java
.
math
.
BigDecimal
;
@
Deprecated
(
since
=
"10.0.3.0"
)
class
SafeDecimalParser
{
/**
* Safe parsing of a String into a Double
*
* @param s The input String, can be null
* @return The Double value
*
*/
@
Deprecated
(
since
=
"10.0.3.0"
)
final
protected
static
Double
decimalValueOf
(
String
s
) {
return
s
!=
null
?
Double
.
valueOf
(
s
) :
null
;
}
/**
* Safe way of getting the double value<br>
* prevents BigDecimal from calling Double.parseDouble()
*
* @param number
* @return the double value
*/
@
Deprecated
(
since
=
"10.0.3.0"
)
final
protected
static
double
decimalValue
(
Number
number
) {
return
number
!=
null
?
number
.
doubleValue
() :
0.0
;
}
/**
* Safe way of getting the double value<br>
* Prevents BigDecimal from calling Double.parseDouble()
*
* @param bigDecimal
* @return the double value
*/
@
Deprecated
(
since
=
"10.0.3.0"
)
final
protected
static
double
decimalValue
(
BigDecimal
bigDecimal
) {
return
bigDecimal
!=
null
?
bigDecimal
.
doubleValue
() :
0.0
;
}
}
Back
|
FazBrowse Home
|
New Git URL