Skip to content

Commit

Permalink
Merge pull request #514 from ApptiveGrid/reapply-scaled-decimal-fix
Browse files Browse the repository at this point in the history
reapplied scaled decimal changes to have controlled conversion
  • Loading branch information
noha authored Nov 21, 2023
2 parents 3948543 + 504c6ac commit 4190c4e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ SoilPrimitiveSerializationTest >> testSerializationScaledDecimal [
serialized := SoilSerializer serializeToBytes: object.

self assert: (serialized at: 1) equals: TypeCodeScaledDecimal.
self assert: serialized equals: #[9 10 1 2].
self assert: serialized equals: #[9 5 10 1 2].
materialized := SoilMaterializer materializeFromBytes: serialized.
self assert: materialized class equals: ScaledDecimal.
self assert: materialized equals: object
Expand Down
2 changes: 1 addition & 1 deletion src/Soil-Serializer/SoilBasicMaterializer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ SoilBasicMaterializer >> nextScaledDecimal: aClass [

| scaledDecimal |
scaledDecimal := aClass new
setNumerator: self nextLengthEncodedInteger
setNumerator: self nextSoilObject
denominator: self nextLengthEncodedInteger
scale: self nextLengthEncodedInteger.
self registerObject: scaledDecimal.
Expand Down
2 changes: 1 addition & 1 deletion src/Soil-Serializer/SoilBasicSerializer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ SoilBasicSerializer >> nextPutScaledDecimal: aNumber [
"we know that numerator, denominator and scale are SmallIntegers"
self
nextPutByte: TypeCodeScaledDecimal;
nextPutLengthEncodedInteger: aNumber numerator;
nextPutInteger: aNumber numerator;
nextPutLengthEncodedInteger: aNumber denominator;
nextPutLengthEncodedInteger: aNumber scale
]
Expand Down

0 comments on commit 4190c4e

Please sign in to comment.