Skip to content

Commit

Permalink
Merge pull request #8 from AKalinich-Luxoft/fix/fix_float_values_in_r…
Browse files Browse the repository at this point in the history
…esponse

Fix float values in GetInteriorVehicleData response
  • Loading branch information
AKalinich-Luxoft authored Jul 12, 2017
2 parents 376f6fd + 3da95e4 commit 9ec9249
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/controller/sdl/RController.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ SDL.RController = SDL.SDLController.extend(
var t = value * 9 / 5 + 32;
var result = {
unit: type,
valueC: value,
valueF: t.toFixed(1)
valueC: parseFloat(value.toFixed(1)),
valueF: parseFloat(t.toFixed(1))
}
return result;
},
Expand Down
8 changes: 4 additions & 4 deletions app/view/climateView.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ SDL.ClimateView = Em.ContainerView.create(
switch (temperature_struct.unit) {
case 'CELSIUS':
{
return temperature_struct.valueC;
return temperature_struct.valueC.toFixed(1);
}
case 'FAHRENHEIT':
{
return temperature_struct.valueF;
return temperature_struct.valueF.toFixed(1);
}
}
}.property(
Expand Down Expand Up @@ -213,11 +213,11 @@ SDL.ClimateView = Em.ContainerView.create(
switch (temperature_struct.unit) {
case 'CELSIUS':
{
return temperature_struct.valueC;
return temperature_struct.valueC.toFixed(1);
}
case 'FAHRENHEIT':
{
return temperature_struct.valueF;
return temperature_struct.valueF.toFixed(1);
}
}
}.property(
Expand Down

0 comments on commit 9ec9249

Please sign in to comment.