BSONObjBuilder builder; builder.appendNumber("score", 9.5);
bsoncxx::builder::basic::document builder; builder.append(kvp("price", 49.99));This example uses the bsoncxx library to create a BSON object. We create a builder object of type bsoncxx::builder::basic::document and use the append() method to add a key-value pair to the BSON object. The key is "price" and the value is a floating-point number 49.99. In conclusion, the BSONObjBuilder appendNumber method is used to add a floating-point number to a BSON object in C++. It is a part of the MongoDB C++11 driver library and bsoncxx library.