-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing issue with timespans having fractional millisecond values (#497)
* fixing issue with timespans having fractional values * fixign test * fixing test * more test fixes
- Loading branch information
1 parent
52bff7f
commit 48ea85e
Showing
5 changed files
with
64 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Globalization; | ||
|
||
namespace Redis.OM; | ||
|
||
/// <summary> | ||
/// Extension methods for Timespans. | ||
/// </summary> | ||
internal static class TimespanExtensions | ||
{ | ||
/// <summary> | ||
/// Rounds up total milliseconds as an integer. | ||
/// </summary> | ||
/// <param name="ts">the timespan.</param> | ||
/// <returns>the rounded timespan milliseconds.</returns> | ||
public static string TotalMillisecondsString(this TimeSpan ts) | ||
{ | ||
return Math.Ceiling(ts.TotalMilliseconds).ToString(CultureInfo.InvariantCulture); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters