-
Notifications
You must be signed in to change notification settings - Fork 80
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 values
- Loading branch information
1 parent
73b528e
commit 861ce1a
Showing
4 changed files
with
62 additions
and
16 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