Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions ExtLibs/Mavlink/MAVLinkParam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,18 @@ public double GetValue()
0.8
(double)item.float_value
0.800000011920929
*/
return Math.Round((double)float_value, 7);
*/ {
//In case of very large numbers, decimal conversion could fail. In that case fall back to straight double conversion
try
{
return (double)(decimal)float_value;

}
catch
{
return Math.Round((double)float_value, 7);
}
}
}

throw new FormatException("invalid type");
Expand Down