simplifying logic regarding decision to format with decimal part
This commit is contained in:
1 parent
ef59511a01
commit
d6bc6fa289
1 file changed
+3
-7
@@ -26,13 +26,9 @@ namespace mbts.spark {
|
||||
|
||||
public static string format(this ContractSpecificationImmutable spec, double price, double with_regard_to_price, bool in_tick_terms) {
|
||||
double net_change = price - with_regard_to_price;
|
||||
if (in_tick_terms) {
|
||||
return (in_tick_terms) ? TickStore.get(spec).format_without_decimal_part((net_change) / spec.ticksize(net_change)) :
|
||||
TickStore.get(spec).format_without_decimal_part(net_change);
|
||||
} else {
|
||||
return (in_tick_terms) ? TickStore.get(spec).format((net_change) / spec.ticksize(net_change)) :
|
||||
TickStore.get(spec).format(net_change);
|
||||
}
|
||||
return (in_tick_terms) ?
|
||||
TickStore.get(spec).format_without_decimal_part((net_change) / spec.ticksize(net_change)) :
|
||||
TickStore.get(spec).format(net_change);
|
||||
}
|
||||
|
||||
public static string format(this ContractSpecificationImmutable spec, double price) =>
|
||||
|
||||
Reference in new issue
Block a user