Skip to content

Commit

Permalink
Fixes GetContractMultiplier
Browse files Browse the repository at this point in the history
GetContractMultiplier was rounding contract multiplier incorrectly,
leading to an unsuccessful contract details request. E.g. LBR multiplier
is 27.5 and was converted to "28" instead of "27.5".

Instead of rounding all multipliers above 1, we will only round them if
the decimal part is zero.
  • Loading branch information
AlexCatarino committed Apr 24, 2024
1 parent 8199faa commit 10bb17e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4119,7 +4119,7 @@ public IEnumerable<Symbol> LookupSymbols(Symbol symbol, bool includeExpired, str

private static string GetContractMultiplier(decimal contractMultiplier)
{
if (contractMultiplier >= 1)
if (contractMultiplier % 1 == 0)
{
// IB doesn't like 5000.0
return Convert.ToInt32(contractMultiplier).ToStringInvariant();
Expand Down

0 comments on commit 10bb17e

Please sign in to comment.