Skip to content
Snippets Groups Projects
Commit 6490dffb authored by es23's avatar es23 :coffee:
Browse files

rounding match queries

parent 5ee3f0ce
Branches
No related tags found
4 merge requests!449Homologa,!444dev -> hom,!440New indicators,!438Taxa de Estudantes que Recebem Auxílio do Bolsa Família
services:
simcaq-node:
container_name: simcaq-node
build: .
ports:
- '3000:3000'
develop:
watch:
- action: sync
path: .
target: /API
#!/bin/bash
echo "Starting simcaq-node"
gulp watch &> /dev/null &
cd build
NODE_ENV=production gulp run
......@@ -43,12 +43,12 @@ gulp.task('compile', ['lint'], () => {
gulp.src('src/**/*.js')
.pipe(cache.filter()) // cache source files
.pipe(babel()) // compile only modified files
// .pipe(cache.cache()) // cache compiled files
.pipe(cache.cache()) // cache compiled files
.pipe(gulp.dest('build')); // move compiled files to build directory
});
gulp.task('build', ['compile'], () => {
var filesToCopy = [ 'config.json', 'package.json' ];
var filesToCopy = [ 'config.json', 'package.json', '.eslintignore', '.eslintrc.json' ];
// copy configuration file to build directory
gulp.src(filesToCopy)
.pipe(gulp.dest('build'));
......@@ -93,24 +93,16 @@ gulp.task('test', ['pre-test'], () => {
});
});
gulp.task('watch', ['compile'], () => {
gulp.task('watch', () => {
console.log('Watching source directory for changes');
gulp.watch('src/**/*.js').on('change', () => {
return gulp.watch('src/**/*.js').on('change', () => {
console.log('Recompiling source');
gulp.start('compile');
console.log('Source recompilation done');
});
});
gulp.task('run', () => {
process.chdir('build');
nodemon({
script: 'server.js',
tasks: ['watch'],
ignore: ["test/test.js", "gulpfile.babel.js"],
ext: 'js html json',
env: { 'NODE_ENV': process.env.NODE_ENV }
});
gulp.task('default', () => {
console.log("Não execuatar apenas gulp, execute da forma:");
console.log("\t\tgulp <task>");
});
gulp.task('default', ['run']);
const gulp = require('gulp');
const nodemon = require('gulp-nodemon');
gulp.task('run', () => {
// process.chdir('build');
nodemon({
script: 'server.js',
// tasks: ['watch'],
ignore: ["test/test.js", "gulpfile.babel.js"],
ext: 'js html json',
env: { 'NODE_ENV': process.env.NODE_ENV }
});
});
gulp.task('default', () => {
console.log("Não execuatar apenas gulp, execute da forma:");
console.log("\t\tgulp <task>");
});
......@@ -566,8 +566,11 @@ function matchQueries(queryPartial, queryTotal) {
if(objMatch) {
newObj.denominator = result.total;
newObj.denominator = Number(newObj.denominator.toFixed(2));
newObj.partial = objMatch.total;
newObj.partial = Number(newObj.total.toFixed(2));
newObj.total = (objMatch.total / result.total) * 100;
newObj.total = Number(newObj.total.toFixed(2));
match.push(newObj);
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment