mirror of
https://github.com/jwetzell/showbridge-docs.git
synced 2026-09-03 11:18:58 +00:00
format
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
---
|
||||
title: Parse Float
|
||||
sidebar:
|
||||
label: Parse
|
||||
order: 1
|
||||
label: Parse
|
||||
order: 1
|
||||
---
|
||||
|
||||
The `float.parse` processor takes a string and parses it as a float with the specified `base` and `bitSize`. This processor will return an error if the message being processed is not a string or if the string cannot be parsed into a float.
|
||||
|
||||
- **type**: `float.parse`
|
||||
- **params**:
|
||||
- **bitSize**: (optional) the bit size of the float to parse, defaults to 64
|
||||
- **bitSize**: (optional) the bit size of the float to parse, defaults to 64
|
||||
|
||||
### Example
|
||||
|
||||
This would parse the string payload as a 32 bit float and set the payload to that value.
|
||||
|
||||
```yaml
|
||||
- type: float.parse
|
||||
params:
|
||||
bitSize: 32
|
||||
```
|
||||
```
|
||||
|
||||
@@ -1,23 +1,26 @@
|
||||
---
|
||||
title: Create Random Float
|
||||
sidebar:
|
||||
label: Random
|
||||
order: 2
|
||||
label: Random
|
||||
order: 2
|
||||
---
|
||||
|
||||
The `float.random` processor will set the payload to a random float between the specified `min` and `max` value.
|
||||
|
||||
- **type**: `float.random`
|
||||
- **params**:
|
||||
- **bitSize**: (optional) the bit size of the float to generate, defaults to 32
|
||||
- **min**: the minimum value for the random float (inclusive).
|
||||
- **max**: the maximum value for the random float (exclusive).
|
||||
- **bitSize**: (optional) the bit size of the float to generate, defaults to 32
|
||||
- **min**: the minimum value for the random float (inclusive).
|
||||
- **max**: the maximum value for the random float (exclusive).
|
||||
|
||||
### Example
|
||||
|
||||
This would generate a random 64-bit float between 1.1 and 1.5 and set the payload to that value.
|
||||
|
||||
```yaml
|
||||
- type: float.random
|
||||
params:
|
||||
bitSize: 64
|
||||
min: 1.0
|
||||
max: 1.5
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user