Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
simcaq
simcaq-node
Commits
696127e2
Commit
696127e2
authored
6 years ago
by
Vytor Calixto
Browse files
Options
Download
Plain Diff
Merge branch 'hotfix_v1.0.2'
parents
ee557166
21f6eeef
Pipeline
#15236
failed with stage
in 60 minutes and 4 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+4
-0
CHANGELOG.md
src/libs/routes/pibpercapita.js
+16
-14
src/libs/routes/pibpercapita.js
with
20 additions
and
14 deletions
+20
-14
CHANGELOG.md
+
4
-
0
View file @
696127e2
...
...
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on
[
Keep a Changelog
](
http://keepachangelog.com/
)
and this project adheres to
[
Semantic Versioning
](
http://semver.org/
)
.
## 1.0.2 - 2018-04-18
### Changed
-
Fixed bug in pibpercapita route
## 1.0.1 - 2018-03-15
### Changed
-
Fix missing school id in teacher and class routes
...
...
This diff is collapsed.
Click to expand it.
src/libs/routes/pibpercapita.js
+
16
-
14
View file @
696127e2
...
...
@@ -86,8 +86,8 @@ rqf.addField({
}).
addValue
({
name
:
'
state
'
,
table
:
'
estado
'
,
tableField
:
'
nome
'
,
resultField
:
'
state_name
'
,
tableField
:
[
'
nome
'
,
'
id
'
],
resultField
:
[
'
state_name
'
,
'
state_id
'
],
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
...
...
@@ -163,21 +163,23 @@ pibpercapitaApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
.
order
(
'
ibge_pib.ano_censo
'
)
}
next
();
},
query
,
addMissing
(
rqf
),
id2str
.
transform
(
false
),
(
req
,
res
,
next
)
=>
{
},
query
,
(
req
,
res
,
next
)
=>
{
req
.
result
.
forEach
((
i
)
=>
{
let
value
=
i
.
total
;
let
res
=
value
.
toString
().
split
(
"
.
"
);
//rounding decimal.
let
decimal
=
Math
.
round
(
res
[
1
].
toString
().
substring
(
0
,
2
)
+
(
"
.
"
)
+
res
[
1
].
toString
().
substring
(
2
,
3
));
//case 0 after comma
if
(
res
[
1
].
toString
().
substring
(
0
,
1
)
==
0
)
{
i
.
total
=
parseFloat
(
res
[
0
]
+
"
.
"
+
"
0
"
+
decimal
);
}
else
{
i
.
total
=
parseFloat
(
res
[
0
]
+
"
.
"
+
decimal
);
}
let
value
=
i
.
total
;
console
.
log
(
i
.
total
);
let
res
=
value
.
toString
().
split
(
"
.
"
);
//rounding decimal.
let
decimal
=
Math
.
round
(
res
[
1
].
toString
().
substring
(
0
,
2
)
+
(
"
.
"
)
+
res
[
1
].
toString
().
substring
(
2
,
3
));
//case 0 after comma
if
(
res
[
1
].
toString
().
substring
(
0
,
1
)
==
0
)
{
i
.
total
=
parseFloat
(
res
[
0
]
+
"
.
"
+
"
0
"
+
decimal
);
}
else
{
i
.
total
=
parseFloat
(
res
[
0
]
+
"
.
"
+
decimal
);
}
console
.
log
(
i
.
total
);
});
next
();
},
response
(
"
pibpercapita
"
));
},
addMissing
(
rqf
),
id2str
.
transform
(
false
),
response
(
"
pibpercapita
"
));
module
.
exports
=
pibpercapitaApp
;
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help