MongoDB\BSON\Decimal128::__construct

(mongodb >=1.2.0)

MongoDB\BSON\Decimal128::__construct β€” Construct a new Decimal128

Опис

final public MongoDB\BSON\Decimal128::__construct(string $value)

ЗауваТСння: Клас MongoDB\BSON\Decimal128 доступний Π² MongoDB 3.4+. Π‘ΠΏΡ€ΠΎΠ±Π° використати Ρ†Π΅ΠΉ BSON-Ρ‚ΠΈΠΏ Π² ΡΡ‚Π°Ρ€Ρ–ΡˆΠΈΡ… вСрсіях MongoDB Π²ΠΈΠΊΠ»ΠΈΡ‡Π΅ ΠΏΠΎΠΌΠΈΠ»ΠΊΡƒ.

ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ΠΈ

value (string)

A decimal string.

Помилки/Π²ΠΈΠΊΠ»ΡŽΡ‡Π΅Π½Π½Ρ

ΠŸΡ€ΠΈΠΊΠ»Π°Π΄ΠΈ

ΠŸΡ€ΠΈΠΊΠ»Π°Π΄ #1 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));

?>

Поданий Π²ΠΈΡ‰Π΅ ΠΏΡ€ΠΈΠΊΠ»Π°Π΄ Π²ΠΈΠ²Π΅Π΄Π΅ Ρ‰ΠΎΡΡŒ схоТС Π½Π°:

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"
}

ΠŸΡ€ΠΎΠ³Π»ΡΠ½ΡŒΡ‚Π΅ Ρ‚Π°ΠΊΠΎΠΆ

οΌ‹add a note

User Contributed Notes

There are no user contributed notes for this page.