Question: I'm getting a Bluetooth Characteristic from a Bluetooth controller with [flutter blue](https://pub.dev/documentation/flutter_blue/latest/flutter_blue/BluetoothCharacteristic-class.html) as a List. This characteristic contains weight measurement of a Bluetooth scale. Is there a function to convert this list of ints to a Double?

I tried to find some background on float representations by reading the IEEE 754 standard. There is the dart library typed\_data but I am new to dart and have no experience with this lib.

Example: 

I have this List: [191, 100, 29, 173] which is coming from a bluetooth controller as a IEEE754 representation for a float value. 
Now i believe i have to convert each int to hex and concat these values: `bf 64 1d ad`

Next thing need to do is convert this to double, but i cannot find a function to convert hex to double. Only `int.parse("0xbf641dad")`.

Answer: 
You may need this:

```
double parseHexString(String hexStr,  bool littleEndian){
  if(hexStr.length % 2 != 0){
    return 0;
  }
  if(littleEndian == true){
    List<int> bytes = hex.decode(hexStr).reversed.toList();
    hexStr = hex.encode(bytes);
  }
  var byteConvert = ByteData(12);
  byteConvert.setInt64(0, int.parse(hexStr,radix: 16));
  return byteConvert.getFloat64(0);}

```

And demo :

```
double lat = parseHexString("0000004069665E40",true);
//lat = 121.60017395019531

```
I used dart:typed\_data for this:

```
import 'dart:typed_data';

List<int> intList = [191, 100, 29, 173];
double asFloat = ByteData.view(Uint8List.fromList(List.from(intList)).buffer).getFloat32(0, Endian.little);

```

Library reference: <https://api.dart.dev/be/136883/dart-typed_data/dart-typed_data-library.html>