Difference between revisions of "DecimalForCopyPaste"
(Created page with "category:System Variables ''new to Analytica 5.0'' == SysVar DecimalForCopyPaste == === Background: International conventions for the decimal point === In many coun...")
Revision as of 21:53, 9 September 2016
new to Analytica 5.0
Background: International conventions for the decimal point
In many countries, including almost all English-speaking countries, the dot (
'.' = Chr(46)) is used as the decimal point in fractional numbers, whereas in other parts of the world the comma (
',' = Chr(44)) is used as the decimal point. Where the dot is used, the comma is generally used to group digits into thousands, while the regions that use the comma as a decimal generally use the dot a thousands separators.
One-thousand two-hundred thirty-four point 56 is written as
Analytica's user interface uses the dot-as-decimal convention, e.g.,
3.14159 -- the convention used in English-speaking countries (except Rep of South Africa), Mexico and central America, East Asia (except Indonesia), Egypt and most south, east and west African nations. Within the UI, it does not mix conventions. In particular, the comma has a specific use in expressions as the parameter separator character, and hence cannot be used in expressions without introducing a syntactic ambiguity.
There are a few countries in the middle east that make use a character other that the dot or comma as a decimal point. Analytica does not handle these conventions.
Copy and Pasting
If you are in a country that uses the comma-as-decimal convention, which includes mainland Europe, South America, and much of central and northern Africa, you may run into an issue with copying or pasting data between Analytica and other application programs. Obviously, when copying numbers over the clipboard, both applications need to used the same convention.
The Analytica system variable DecimalForCopyPaste controls the convention that Analytica uses when copying data to or from the clipboard. It can be assigned to be any of the following possible values:
'TextLocale': (default) Uses the convention from the region specified in the system variable TextLocale.
'Region': Uses the convention set by your operating system's regional settings.
'.': Forces the dot-as-decimal convention.
',': Forces the comma-as-decimal convention
By default, TextLocale is used, which in turn by default uses your regional setting unless you have changed it.
The system variable is a user-level setting, so that it applies to your account on your computer, not to your model. If you change it, the setting will persist after you quit and restart Analytica. The setting is not saved with your model, so changing this will have no impact on other users of your models.
When to change
You will only need to change this if you encounter an application that uses the opposite convention and you need to copy/paste data to or from that application. For example, you might be in Italy, where the comma-as-decimal convention is used, but find you need to copy/paste data from an application that uses the dot-as-decimal convention.
You might also download some data from the internet that uses a convention other than your local convention, and find you need to copy that data into an edit table in your model, for example while viewing the data in a text editor.
Another scenario would be when you need to copy some data into an email that you are sending to someone in a different country, who expects a different convention.
How to change
To change the convention used, from Edit mode, with nothing selected, navigate from the main Analytica menu to
- Definition → System Variables → Settings → Decimal for copy/paste
This opens the Object Window for DecimalForCopyPaste. From there, change the definition to one of the permitted values.
Excel uses the system regional setting by default. This will match the default setting used by Analytica, unless you've changed the default in either Excel or Analytica.
Excel allows you to change the convention it uses from the File / Options / Advanced panel, where you can customize the Use system separators.
What is and is not affected
Basically, only data passed via Copy/Paste or OLE linking are impacted by this system variable. Data passed through other channels are not impacted by this system variable. When you copy to the clipboard, an application can post multiple formats. The Text and Unicode Text formats are the formats that are impacted.
OLE linking is impacted by this setting. Hence, the Analytica setting and your target application's convention must agree. Once you've set up a link (via Copy/Paste Special...), you don't need to redo the link if you change the setting, but you may need to refresh the data.
The Analytica user-interface displays everything using the dot-as-decimal convention. This cannot be changed.