How to update % printed to Console from MongoDB?

MongoDBDatabaseBig Data Analytics

To update and print to console from MongoDB script, create a variable and then use the print() method.

Let us first create a variable −

> var amount=10.58945;

Here is the query to update % printed to console −

> var amount=10.58945;
> print(amount.toFixed(2)+" %");

This will produce the following output −

10.59 %
raja
Published on 31-Mar-2020 08:23:21
Advertisements