Skip to content
Snippets Groups Projects
Commit a497d3bb authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Merge branch 'hotfix_v1.0.2' into development

parents d72bf9f2 21f6eeef
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ...@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added ### Added
* Out of school population indicator * Out of school population indicator
## 1.0.2 - 2018-04-18
### Changed
- Fixed bug in pibpercapita route
## 1.0.1 - 2018-03-15 ## 1.0.1 - 2018-03-15
### Changed ### Changed
- Fix missing school id in teacher and class routes - Fix missing school id in teacher and class routes
......
...@@ -86,8 +86,8 @@ rqf.addField({ ...@@ -86,8 +86,8 @@ rqf.addField({
}).addValue({ }).addValue({
name: 'state', name: 'state',
table: 'estado', table: 'estado',
tableField: 'nome', tableField: ['nome', 'id'],
resultField: 'state_name', resultField: ['state_name', 'state_id'],
where: { where: {
relation: '=', relation: '=',
type: 'integer', type: 'integer',
...@@ -163,21 +163,23 @@ pibpercapitaApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => { ...@@ -163,21 +163,23 @@ pibpercapitaApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
.order('ibge_pib.ano_censo') .order('ibge_pib.ano_censo')
} }
next(); next();
}, query, addMissing(rqf), id2str.transform(false), (req, res, next) => { }, query, (req, res, next) => {
req.result.forEach((i) => { req.result.forEach((i) => {
let value = i.total; let value = i.total;
let res = value.toString().split("."); console.log(i.total);
//rounding decimal. let res = value.toString().split(".");
let decimal = Math.round(res[1].toString().substring(0,2) + (".") + res[1].toString().substring(2,3)); //rounding decimal.
//case 0 after comma let decimal = Math.round(res[1].toString().substring(0,2) + (".") + res[1].toString().substring(2,3));
if (res[1].toString().substring(0,1) == 0) { //case 0 after comma
i.total = parseFloat(res[0] + "." + "0" + decimal); if (res[1].toString().substring(0,1) == 0) {
} else { i.total = parseFloat(res[0] + "." + "0" + decimal);
i.total = parseFloat(res[0] + "." + decimal); } else {
} i.total = parseFloat(res[0] + "." + decimal);
}
console.log(i.total);
}); });
next(); next();
}, response("pibpercapita")); }, addMissing(rqf), id2str.transform(false), response("pibpercapita"));
module.exports = pibpercapitaApp; module.exports = pibpercapitaApp;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment