0

It is anyway to set decimal separator in Octave different from OS default locale for decimals.

For example: normally I used point(.) for decimal separator like US locale, but sometimes I need to plot data that need to be presented with comma(,) as decimal separator like Europe locale.

How can it be done in Octave enviroment?

gvd
  • 1,482
  • 6
  • 32
  • 58

1 Answers1

3

I don't think octave supports locales like this. Maybe if you compile it from the very beginning against a particular locale, but I wouldn't advise that anyway.

Your best bet is to pre-process all relevant strings to replace dots with commas etc.

Alternatively you can rely on an external utility (e.g. the printf command in bash) to create a file of strings and then read them from your octave script.

Another thing to try is to try and replicate this https://undocumentedmatlab.com/articles/formatting-numbers/ in octave

(but, disclaimer, I tried, but run into this bug, which I reported just now: https://savannah.gnu.org/bugs/?60396)

Tasos Papastylianou
  • 21,371
  • 2
  • 28
  • 57