# Decimal point or comma

**URL:** <https://discourse.processing.org/t/decimal-point-or-comma/14819>\
**Category:** Coding Questions\
**Created:** [October 20, 2019, 9:31am UTC](https://discourse.processing.org/t/decimal-point-or-comma/14819 "2019-10-20T09:31:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![micha](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@micha](https://discourse.processing.org/u/micha)\
**Post date:** [October 20, 2019, 9:31am UTC](https://discourse.processing.org/t/decimal-point-or-comma/14819/1 "2019-10-20T09:31:48Z")

</div>

I am working with Processing 3.5.3 on a Mac with german system osx 10.11.6  
When I say

float number = 0.2;  
println(nf(number, 1, 2));

it prints

0,20  
with decimal comma (common in everyday german life)  
Is there a way to change this back?

---

<div class="post-metadata">

**Author:** ![Tiemen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tiemen/32/5477_2.png) [@Tiemen](https://discourse.processing.org/u/Tiemen)\
**Post date:** [October 20, 2019, 10:08am UTC](https://discourse.processing.org/t/decimal-point-or-comma/14819/2 "2019-10-20T10:08:40Z")

</div>

As you Dutch neighbour I encounter the same issue, believe it has to do with the default settings of our Operating System. Via your sketch you can adjust it by importing the Locale Class and setting the language settings to US:

```auto
import java.util.Locale;

void setup() {
  size(200, 200);
  noLoop();
  Locale.setDefault(Locale.US);
}

void draw() {
  float f = 9.012;
  String sf = nf(f, 3, 5);
  println(sf);
}

```

If you prefer that all your sketches use the dot automatically, other options to look into are:

- change the language settings of your OS
- tweak the language setting in the core files of Processing

Not sure the latter option works though.

---

<div class="post-metadata">

**Author:** ![micha](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@micha](https://discourse.processing.org/u/micha)\
**Post date:** [October 20, 2019, 11:25am UTC](https://discourse.processing.org/t/decimal-point-or-comma/14819/3 "2019-10-20T11:25:46Z")

</div>

Dear Neighbour!  
It works.  
Most of the time I need this printouts for control, but sometime I need them for another program.

Thanks a lot, Michael
