Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
6124528e
Commit
6124528e
authored
5 years ago
by
uhensler
Browse files
Options
Downloads
Patches
Plain Diff
OO-4407: Fix broken unit tests
parent
cee3a5f7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/modules/forms/model/jpa/CalculatedLong.java
+10
-1
10 additions, 1 deletion
...java/org/olat/modules/forms/model/jpa/CalculatedLong.java
with
10 additions
and
1 deletion
src/main/java/org/olat/modules/forms/model/jpa/CalculatedLong.java
+
10
−
1
View file @
6124528e
...
@@ -44,7 +44,7 @@ public class CalculatedLong {
...
@@ -44,7 +44,7 @@ public class CalculatedLong {
}
}
public
CalculatedLong
(
String
identifier
,
BigDecimal
subIdentifier
,
long
value
)
{
public
CalculatedLong
(
String
identifier
,
BigDecimal
subIdentifier
,
long
value
)
{
this
(
identifier
,
subIdentifier
.
toPlainString
(),
value
);
this
(
identifier
,
trimZerosFromEnd
(
subIdentifier
.
toPlainString
()
)
,
value
);
}
}
public
CalculatedLong
(
String
identifier
,
String
subIdentifier
,
long
value
)
{
public
CalculatedLong
(
String
identifier
,
String
subIdentifier
,
long
value
)
{
...
@@ -65,5 +65,14 @@ public class CalculatedLong {
...
@@ -65,5 +65,14 @@ public class CalculatedLong {
public
long
getValue
()
{
public
long
getValue
()
{
return
value
;
return
value
;
}
}
private
static
String
trimZerosFromEnd
(
String
value
)
{
int
len
=
value
.
length
();
int
st
=
0
;
while
((
st
<
len
)
&&
(
value
.
charAt
(
len
-
1
)
==
'0'
||
value
.
charAt
(
len
-
1
)
==
'.'
))
{
len
--;
}
return
value
.
substring
(
0
,
len
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment