MongoDB\BSON\Decimal128::__construct

Construct a new Decimal128

&reftitle.description; final public `MongoDB\BSON\Decimal128::__construct` `string` `value` &mongodb.note.decimal128;
&reftitle.parameters;

`value` (`string`)

- A decimal string.

&reftitle.errors;

&mongodb.throws.argumentparsing;
- Throws `MongoDB\Driver\Exception\InvalidArgumentException` if `value` is not a valid decimal string.

&reftitle.examples;

### `MongoDB\BSON\Decimal128::__construct` example

    <?php

    var_dump(new MongoDB\BSON\Decimal128(1234.5678));
    var_dump(new MongoDB\BSON\Decimal128(NAN));
    var_dump(new MongoDB\BSON\Decimal128(INF));

    ?>

&example.outputs.similar;

    object(MongoDB\BSON\Decimal128)#1 (1) {
      ["dec"]=>
      string(9) "1234.5678"
    }
    object(MongoDB\BSON\Decimal128)#1 (1) {
      ["dec"]=>
      string(3) "NaN"
    }
    object(MongoDB\BSON\Decimal128)#1 (1) {
      ["dec"]=>
      string(8) "Infinity"
    }

&reftitle.seealso;

- Decimal128 floating-point format
- BSON Types