# Making a calculator - floating point errors?

**URL:** <https://forums.unrealengine.com/t/making-a-calculator-floating-point-errors/362000>\
**Category:** Community & Industry Discussion\
**Tags:** error, math, variables, float, unreal-engine, question\
**Created:** [June 25, 2016, 4:45pm UTC](https://forums.unrealengine.com/t/making-a-calculator-floating-point-errors/362000 "2016-06-25T16:45:18Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Krxtopher](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Krxtopher](https://forums.unrealengine.com/u/Krxtopher)\
**Post date:** [June 25, 2016, 10:40pm UTC](https://forums.unrealengine.com/t/making-a-calculator-floating-point-errors/362000/4 "2016-06-25T22:40:54Z")

</div>

chulk, unfortunately there isn’t a built-in blueprint function that will let you convert a float to a string with a specific precision, but at least now you know better how to search for an alternative. I’d recommend doing some searching for plugins or blueprint nodes from the community that solve this rather than trying to build your own solution from lower-level blueprint notes. A search phrase like “float to string with precision” should get you started.

Here’s a C++ utility function from the community Wiki that might help (you’d still have to figure out how to turn it into a blueprint node, though):

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

That same author has also created a library of blueprint nodes that install as a plug-in (although I’ve never used these and it looks like it includes tons of other functionality that you may not need and may make it tricky to install):

> **[(39) Rama's Extra Blueprint Nodes for You as a Plugin, No C++ Required!](https://forums.unrealengine.com/showthread.php?3851-%2839%29-Rama-s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required%21%2Fpage27&highlight=rama%20keybind)**
>
> Dear Community, 🌟 Newest Awesome Feature 🌟 (In this Complimentary (no cost) Victory Plugin!) Now You Can Get the Text Output (STDOUT or STDERR) from any .exe program, straight into Unreal Engine! This is the output of ⚡ a video compression...

Finally, if you’d rather build your own solution from lower-level nodes, you might want to check out this AnswerHub answer:

> **[How can I set float precision?](https://forums.unrealengine.com/questions/94901/how-can-i-set-float-precision.html)**
>
> I have a float value (health percentage) that I'm sending to the HUD. However it comes through with many decimal places (ie. 95.6764387) and I want to reduce the precision to 2 (ie. 95.68 as per the previous example). How would I do this?

If my post helps you, consider marking it as a correct answer. Thanks!

---

_[View the full topic](https://forums.unrealengine.com/t/making-a-calculator-floating-point-errors/362000)._
