0

There is a data store with a decimal number when pulling it from the database in a decimal 128 and how can I show it on a client.

how convert data decimal128 to number?

{_bsontype: "Decimal128", bytes: Uint8Array(16)}
 bytes: Uint8Array(16)
_bsontype: "Decimal128"
__ob__: Observer {value: {…}, dep: Dep, vmCount: 0}
get bytes: ƒ reactiveGetter()
set bytes: ƒ reactiveSetter(newVal)
get _bsontype: ƒ reactiveGetter()
set _bsontype: ƒ reactiveSetter(newVal)
__proto__: Object

result show on client

srey pick
  • 19
  • 4
  • How is this related to the `meteor` tag? Please add more information about where the data comes from, how you retrieve it in the client and some code on how you tried to display it (and errors, if it failed). – Jankapunkt May 23 '19 at 09:17
  • this is my code call method `getData() { findStudentByScore .callPromise() .then(res => { console.log(res.score) }) .catch(err => { console.log(err) }) },` But my score Field is Decimal Number. How can I access value form score? – srey pick May 23 '19 at 09:36
  • Please don't add code into comments, as it makes it even harder to get an idea of what the problem is. Rather you may edit your question and append it with code. – Jankapunkt May 23 '19 at 09:38
  • Sorry I try to display value of score that it store in data type decimal – srey pick May 23 '19 at 09:48
  • This is a really low level view of the data. I think your question isn't really about Meteor, it's just a number formatting problem, which is probably answered here: https://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format – Mikkel May 23 '19 at 10:27
  • Possible duplicate of [JavaScript equivalent to printf/String.Format](https://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format) – Mikkel May 23 '19 at 10:28
  • It is not just print before print we need to access data property score that data type is numberDecimal – srey pick May 23 '19 at 10:50

0 Answers0