I've tested the following scenario after tracking down a bug. Can anyone else confirm this is an issue with Salesforce or am I missing something?
Replication steps:
- create a 14-4 percent field on Contact
- populate the field on a new Contact 'frank smith' with '12345678901234.1234'
- setup a javascript remoting call to get 'frank smith' and the new percent field
- inspect the result from the javascript remoting call and observe the result is '12345678901234.123'
Sample VF page:
<apex:page showHeader="true" sidebar="true" controller="Ctl_TestPercent">
<head>
<script>
var findCon = '{!$RemoteAction.Ctl_TestPercent.findCon}';
Visualforce.remoting.Manager.invokeAction(
findCon,
function(result, event) {
// if there was an error
if (event.type=='exception') {
alert(result);
console.log('error result:' + result);
}
// if there was no error continue
else {
console.log(result);
document.getElementById('jsresult').innerHTML=JSON.stringify(result);
}
}
);
</script>
</head>
<body>
<!-- standard result -->
{!con.percent_14_4__c}
<!-- remoting result -->
<div id="jsresult"></div>
</body>
</apex:page>
controller (insert the new contact's ID in the two queries) :
public with sharing class Ctl_TestPercent {
public Contact con {get;set;}
public Ctl_TestPercent() {
con = [SELECT Id,Percent_14_4__c FROM Contact WHERE Id='INSERT ID'];
}
@remoteAction
public static Contact findCon() {
Contact thisCon = [SELECT Id,Percent_14_4__c FROM Contact WHERE Id='INSERT ID'];
return thisCon;
}
}