|
1 | 1 | // Copyright (c) 2013 Andreas Gullberg Larsen ([email protected]).
|
2 | 2 | // https://github.com/angularsen/UnitsNet
|
3 |
| -// |
| 3 | +// |
4 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
|
5 | 5 | // of this software and associated documentation files (the "Software"), to deal
|
6 | 6 | // in the Software without restriction, including without limitation the rights
|
7 | 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8 | 8 | // copies of the Software, and to permit persons to whom the Software is
|
9 | 9 | // furnished to do so, subject to the following conditions:
|
10 |
| -// |
| 10 | +// |
11 | 11 | // The above copyright notice and this permission notice shall be included in
|
12 | 12 | // all copies or substantial portions of the Software.
|
13 |
| -// |
| 13 | +// |
14 | 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15 | 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16 | 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26 | 26 | using Newtonsoft.Json;
|
27 | 27 | using Newtonsoft.Json.Linq;
|
28 | 28 | using UnitsNet.InternalHelpers;
|
| 29 | +using UnitsNet.Units; |
29 | 30 |
|
30 | 31 | namespace UnitsNet.Serialization.JsonNet
|
31 | 32 | {
|
@@ -130,7 +131,7 @@ private static object CreateQuantity(Type quantityType, double value, object uni
|
130 | 131 |
|
131 | 132 | // Ex: Mass.From(55, MassUnit.Gram)
|
132 | 133 | // TODO: there is a possible loss of precision if base value requires higher precision than double can represent.
|
133 |
| - // Example: Serializing Information.FromExabytes(100) then deserializing to Information |
| 134 | + // Example: Serializing Information.FromExabytes(100) then deserializing to Information |
134 | 135 | // will likely return a very different result. Not sure how we can handle this?
|
135 | 136 | return notNullableFromMethod.Invoke(null, new[] {quantityValue, unitValue});
|
136 | 137 | }
|
@@ -196,7 +197,7 @@ public override void WriteJson(JsonWriter writer, object obj, JsonSerializer ser
|
196 | 197 | TypeNameHandling = serializer.TypeNameHandling,
|
197 | 198 | };
|
198 | 199 | JToken t = JToken.FromObject(obj, localSerializer);
|
199 |
| - |
| 200 | + |
200 | 201 | t.WriteTo(writer);
|
201 | 202 | return;
|
202 | 203 | }
|
|
0 commit comments