# Toy program for dividing monetary values

**URL:** <https://fortran-lang.discourse.group/t/toy-program-for-dividing-monetary-values/2255>\
**Category:** Announcements\
**Created:** [November 9, 2021, 4:37pm UTC](https://fortran-lang.discourse.group/t/toy-program-for-dividing-monetary-values/2255 "2021-11-09T16:37:46Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![FortranFan](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@FortranFan](https://fortran-lang.discourse.group/u/FortranFan)\
**Post date:** [November 9, 2021, 10:39pm UTC](https://fortran-lang.discourse.group/t/toy-program-for-dividing-monetary-values/2255/3 "2021-11-09T22:39:08Z")

</div>

> [@art-rasa](#):
>
> … The code example shown attempts to divide a sum of money as fairly as possible. I expanded the example a bit so that it can work with decimal numbers, such as $19.99 or 19.99 € instead of just integer values. …

Recent discussions around “[**string to floating-point**](https://fortran-lang.discourse.group/t/faster-string-to-double/2208/4)” utility are relevant to this example. Having such a utility, either as pure Fortran in Fortran `stdlib` or as an interface to some other standard libraries such as those with C, can be useful when Fortranners want to try out such programs.

---

_[View the full topic](https://fortran-lang.discourse.group/t/toy-program-for-dividing-monetary-values/2255)._
