Let's talk about numeric data, ways of creation and modification. But first, let's remember/learn what Float and Integer are and how they differ.

Float → Floating-point number

If we talk about the definition, we can refer to Wikipedia:

Floating-point number — a representation of real numbers in which a number is stored in the form of a mantissa and an exponent. A floating-point number has a fixed relative precision, depending on the number of mantissa digits, and a varying absolute precision.

Example: 1.5 or 0.314 or -1.235572334, etc.

Integer → Integer number

You can read more about it on Wikipedia, but for us, it is enough to say that it is a whole number and it looks like this: 1 or 200 or 34, etc.

In this section, it is important for us to understand the practical differences and when to use each data type. But let's start with creation.

There are 2 nodes: Number for creating Float data and Integer for creating Integer data.

<aside> 📌 To create a node using its name, such as Number or Integer, double-click in the grasshopper window and type the name of the node you are looking for:

https://prod-files-secure.s3.us-west-2.amazonaws.com/ee848b0b-0549-4363-9009-29b090347be4/7e340416-27ab-4eac-b814-7bbb54c5ce74/Untitled.png

</aside>

https://prod-files-secure.s3.us-west-2.amazonaws.com/ee848b0b-0549-4363-9009-29b090347be4/1b658930-5323-4535-9e43-a1b10f51e41c/Untitled.png

Right-click on the node and in the menu, select "Set Number." Then enter the desired value and confirm it by clicking "Commit changes." ⚠️ Data will not be saved without confirmation.

https://prod-files-secure.s3.us-west-2.amazonaws.com/ee848b0b-0549-4363-9009-29b090347be4/8d90a979-0ac5-44d7-8f8f-6e2724e6551d/Untitled.png

The Integer node works the same way. Note that the input field will not restrict you, and you can enter a Float number, but after confirmation, you will see that the node stores an integer value.

https://prod-files-secure.s3.us-west-2.amazonaws.com/ee848b0b-0549-4363-9009-29b090347be4/9f028cd1-7bb2-4594-a82f-e007da503834/Untitled.png

https://prod-files-secure.s3.us-west-2.amazonaws.com/ee848b0b-0549-4363-9009-29b090347be4/79e75ecd-72fe-41cb-a9b0-f1dc2b781332/Untitled.png

This happens because Grasshopper, if possible, converts the data to the type required by the node.

<aside> 💡 The conversion from Float to Integer follows a basic mathematical rule. If the value is greater than or equal to 0.5, it becomes the next integer (rounded up), and if it is less, it becomes 0.

Here are a few examples:

23.45 → 23

23.5 → 24

0.3 → 0

0.5 → 1

</aside>

You can also connect two nodes in sequence and perform the conversion like this:

https://prod-files-secure.s3.us-west-2.amazonaws.com/ee848b0b-0549-4363-9009-29b090347be4/2fd59746-caee-415b-be15-e0458f728f0f/Untitled.png