mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 06:43:24 +00:00
rename formatters more sanely, adding mass formatter
This commit is contained in:
@@ -17,9 +17,10 @@ angular.module('app', ['ngRoute','shipyard','ngLodash','app.templates'])
|
||||
$rootScope.ships = DB.ships;
|
||||
|
||||
// Formatters
|
||||
$rootScope.credits = d3.format(',.0f');
|
||||
$rootScope.power = d3.format(',.2f');
|
||||
$rootScope.percent = d3.format(',.2%');
|
||||
$rootScope.fCrd = d3.format(',.0f');
|
||||
$rootScope.fPwr = d3.format(',.2f');
|
||||
$rootScope.fMass = d3.format(',.2r');
|
||||
$rootScope.fPct = d3.format(',.2%');
|
||||
|
||||
$rootScope.calcJumpRange = function(mass, fsd, fuel) {
|
||||
return Math.pow( (fuel || fsd.maxfuel) / fds.fuelmul, 1 / fsd.fuelpower ) * fsd.optmass / mass;
|
||||
|
||||
Reference in New Issue
Block a user