如何更改浮点数的格式?

时间:2017-10-20 02:59:09

标签: php number-formatting

我会改变这个:

import { Component, Input, Output, EventEmitter, NgModule } from '@angular/core';

import { PipesModule } from '../../../pipes/pipes.module';
/**
 * Generated class for the CompanyDirectoryComponent component.
 *
 * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html
 * for more info on Angular Components.
 */
@NgModule({
  imports: [ PipesModule ],
  declarations: [ ],
  bootstrap: [ ]
})
@Component({
  selector: 'company-directory',
  templateUrl: 'company-directory.html'
})
export class CompanyDirectoryComponent {

   // Component code goes here
}

到这个

0.18115942028986

如何处理18.1159 或php中的其他功能?

1 个答案:

答案 0 :(得分:1)

$myNewValue = floor($myValue*1000000)/10000;

更多信息来自PHP FLOOR - PHP CEIL - PHP ROUND