exchange.SetPrecision
Sets the precision of the price and order amount for the exchange object. Once set, the system will automatically ignore any excess portion of the data that exceeds the specified precision.
exchange.SetPrecision(pricePrecision, amountPrecision)Examples
Set prices to 2 decimal places and order amounts to 3 decimal places.
javascript
function main(){
// Set the price decimal precision to 2 digits and the order amount decimal precision to 3
// digits
exchange.SetPrecision(2, 3)
}
python
def main():
exchange.SetPrecision(2, 3)
rust
fn main() {
// Set the price decimal precision to 2 digits and the order amount decimal precision to 3
// digits
exchange.SetPrecision(2, 3);
}Arguments
| Name | Type | Required | Description |
pricePrecision | number | Yes | Precision of the price data. |
amountPrecision | number | Yes | Precision of the order amount data. |
See Also
Remarks
The backtesting system does not support this function; the numerical precision in the backtesting system is handled automatically by the system.