From 9f7efd58a1e102737694f4e3f6946dac0eb283bf Mon Sep 17 00:00:00 2001 From: pranshuchittora Date: Tue, 7 Aug 2018 16:22:21 +0530 Subject: [PATCH] doc: improve examples in buffer docs Documentation for BufferwriteDoubleLE/writeDoubleBE is confusing PR-URL: https://github.com/nodejs/node/pull/22170 Fixes: https://github.com/nodejs/node/issues/22158 Reviewed-By: Vse Mozhet Byt Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Reviewed-By: Anna Henningsen --- doc/api/buffer.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index d483fe4033aced..56999a1955d0a1 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -2145,15 +2145,15 @@ endian). `value` *should* be a valid 64-bit double. Behavior is undefined when ```js const buf = Buffer.allocUnsafe(8); -buf.writeDoubleBE(0xdeadbeefcafebabe, 0); +buf.writeDoubleBE(123.456, 0); console.log(buf); -// Prints: +// Prints: -buf.writeDoubleLE(0xdeadbeefcafebabe, 0); +buf.writeDoubleLE(123.456, 0); console.log(buf); -// Prints: +// Prints: ``` ### buf.writeFloatBE(value, offset)