I have a TextField where I allow numbers like 1,4. I am trying ti replace the , to a . so the number will be 1.4.

I am trying this

```
double alphareceipe = double.parse(_alphareceipe.text);
    alphareceipe = alphareceipe.replace("," ".");

```

But get this error:

error: The method 'replace' isn't defined for the class 'double'. (undefined\_method at [brewingapp] lib/screens/calculator/alphaacid.dart:227).

The total code looks like this:

```
import 'package:flutter/material.dart';

import 'package:firebase_admob/firebase_admob.dart';
import 'package:brewingapp/app_localizations.dart';
import 'package:flutter/services.dart';
import 'package:devicelocale/devicelocale.dart';

const String testDevice = "Mobile_id";

class AlphaAcid extends StatefulWidget {
  @override
  _AlphaAcidState createState() => _AlphaAcidState();
}

class _AlphaAcidState extends State<AlphaAcid> {

  }

  String _emiResult = "";

  final TextEditingController _weight = TextEditingController();
  final TextEditingController _alphareceipe = TextEditingController();
  final TextEditingController _alphanew = TextEditingController();

  @override
  void initState() {

    initPlatformState();

    super.initState();
  }

  @override

  String _locale;

  Future<void> initPlatformState() async {

    String currentLocale;

    // Platform messages may fail, so we use a try/catch PlatformException.

    try {
      currentLocale = await Devicelocale.currentLocale;
      print(currentLocale);
    } on PlatformException {
      print("Error obtaining current locale");
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {

      _locale = currentLocale;
    });
  }

  @override

  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(AppLocalizations.of(context).translate('Hopsalpha'),),
          backgroundColor: Colors.green[800],

          //elevation: 0.0,
        ),
        body: Center(
          child: Container(

            child: Column(
              children: <Widget>[
                Container(
                  padding: EdgeInsets.all(20.0),
                  child: TextField(
                    cursorColor: Colors.green[800],
                    controller: _alphareceipe,
                    decoration: InputDecoration(
                        focusedBorder: UnderlineInputBorder(
                          borderSide: BorderSide(color: Colors.green[800], width: 2.0,),
                        ),

                        filled: true,
                        fillColor: Colors.green[10],
                        labelText: _locale != 'da-DK'
                            ? "Alpha acid receipe"
                            : "Alpha syre opskrift",

                        labelStyle: TextStyle(color: Colors.green[800])
                    ),
                    keyboardType: TextInputType.numberWithOptions(decimal: true),

                    inputFormatters: <TextInputFormatter>[
//                      WhitelistingTextInputFormatter.digitsOnly
                    ],
                  ),
                ),
                Container(
                  padding: EdgeInsets.all(20.0),
                  child: TextField(
                    cursorColor: Colors.green[800],
                    controller: _alphanew,
                    decoration: InputDecoration(
                      focusedBorder: UnderlineInputBorder(
                        borderSide: BorderSide(color: Colors.green[800], width: 2.0,),
                      ),
                      filled: true,
                      fillColor: Colors.green[10],
                      //labelText: "Final Gravity (1018)",
                      labelText: _locale != 'da-DK'
                          ? "Your alpha acid"
                          : "Din alpha syre",
                      labelStyle: TextStyle(color: Colors.green[800]),

                    ),
                    keyboardType: TextInputType.numberWithOptions(decimal: true),
                    inputFormatters: <TextInputFormatter>[
                      //WhitelistingTextInputFormatter.digitsOnly
                    ],
                  ),
                ),
                Container(
                  padding: EdgeInsets.all(20.0),
                  child: TextField(
                    cursorColor: Colors.green[800],
                    controller: _weight,
                    decoration: InputDecoration(
                      focusedBorder: UnderlineInputBorder(
                        borderSide: BorderSide(color: Colors.green[800], width: 2.0,),
                      ),
                      filled: true,
                      fillColor: Colors.green[10],
                      //labelText: "Final Gravity (1018)",
                      labelText: _locale != 'da-DK'
                          ? "Weight receipe"
                          : "Vægt i opskrift",
                      labelStyle: TextStyle(color: Colors.green[800]),

                    ),
                    keyboardType: TextInputType.number,
                    inputFormatters: <TextInputFormatter>[
                      WhitelistingTextInputFormatter.digitsOnly
                    ],
                  ),
                ),
                Flexible(
                  fit: FlexFit.loose,
                  child: FlatButton(
                    onPressed: _handleCalculation,
                    //child: Text("Calculate"),
                    child: Text(AppLocalizations.of(context).translate('calculate'),),
                    color: Colors.green[600],
                    textColor: Colors.white,
                    padding: EdgeInsets.only(top: 10.0, bottom: 10.0, left: 24.0, right: 24.0),

                  ),

                ),

                emiResultsWidget(_emiResult)
              ],

            ),
          ),
        ));
  }

  void _handleCalculation() {

    double newWeight = 0.0;
//
//
//
//
//
    double alphareceipe = double.parse(_alphareceipe.text);
    alphareceipe = alphareceipe.replace("," ".");

    int alphanew =int.parse(_alphanew.text);
    int weightreceipe = int.parse(_weight.text);
//
    try {
      newWeight = (weightreceipe * alphareceipe) / alphanew;
      _emiResult =  newWeight.toStringAsFixed(0);

      setState(() {

      });

    } //catch(e) {
    on Exception catch(e){
      print(e);
      setState(() {

      });

    }

    //_emiResult =  A.toStringAsFixed(1);
    //setState(() {

    //});
  }

  Widget emiResultsWidget(emiResult) {

    bool canShow = false;
    String _emiResult = emiResult;

    if(_emiResult.length > 0) {
      canShow = true;
    }

    return

      Container(
        margin: EdgeInsets.only(top: 30.0, left: 20.0, right: 20.0),
        alignment: FractionalOffset.center,
        color: Colors.green[50],

        child: canShow ? Column(

            mainAxisAlignment: MainAxisAlignment.center,

            children: <Widget>[

              Row(
                //crossAxisAlignment: CrossAxisAlignment.start,
                //mainAxisAlignment: MainAxisAlignment.spaceEvenly,

                  children: <Widget> [
                    Padding(
                        padding: EdgeInsets.all(10.0),
                        child:

                        Text(AppLocalizations.of(context).translate('newweight'),
                          style: TextStyle(
                            fontSize: 20.0,
                            fontWeight: FontWeight.bold,
                            color: Colors.green[800],
                          ),

                        )
                    ),
                    SizedBox(width: 20.0,),

                    Text(_emiResult,
                        style: TextStyle(
                          fontSize: 20.0,
                          fontWeight: FontWeight.bold,
                          color: Colors.green[800],

                        )
                    ),
                    SizedBox(width: 10.0,),

                  ]),

            ]

        ) : Container(),
      );

  }

}

```