The Javascript DataView setFloat32() method stores a signed 32-bit float value at the specified offset to the DataView.
dataview.setFloat32(byteOffset, value [, littleEndian])
byteOffset
- the offset, in byte, from the start of the view.value
- the value to set.littleEndian
- Optional, boolean value. If false or undefined, a big-endian value is written. Otherwise use the little endian.Using the setFloat32 method
var buffer = new ArrayBuffer(8); var dataview = new DataView(buffer); dataview.setFloat32(1, 3);/*from w w w . j a v a 2s . c om*/ let a = dataview.getFloat32(1); console.log(a);