Skip to content

Commit

Permalink
refactor: PERIOD to timespan
Browse files Browse the repository at this point in the history
  • Loading branch information
jirikostiha committed Nov 19, 2024
1 parent 0736bcd commit 3e0edfa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/SyncAPIConnector/codes/PERIOD.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Globalization;

namespace Xtb.XApi.Codes;
Expand Down Expand Up @@ -29,8 +30,11 @@ public PERIOD(int code)
{
}

/// <summary> Converts to human friendly string. </summary>
public string? ToFriendlyString() =>
/// <summary> Converts to TimeSpan. </summary>
public TimeSpan ToTimeSpan() => TimeSpan.FromMinutes(Code);

/// <summary> Converts to Alphanumeric Time Interval Notation string. </summary>
public string? ToAtin() =>
Code switch
{
M1_CODE => "M1",
Expand Down

0 comments on commit 3e0edfa

Please sign in to comment.