Question: I try to create a program that can evaluate simple math expression like "4+4". The expression is given from the user. 

The program saves it in a `char*` and then searches for binary operation (+,-,\*,:) and does the operation. 

The problem is that I can't figure out how to convert the **single** `char` into a `double` value. 

I know there is the `atof` function but I want to convert single `char`.

There is a way to do that without creating a `char*`?

Answer: 
YOUR HTML

```
<textarea data-ui-tinymce id="tinymce1" ng-model="data"></textarea>

<form id="image" style="width:0px;height:0;overflow:hidden">
    <input type="file" file-model="imageFile"/>
</form>

```

YOUR TINYMCE CONFIGURATION

```
tinymce.init({
    selector: 'textarea',

    automatic_uploads:true,
    file_browser_callback_types: 'file image media',
    file_browser_callback: function(field_name, url, type, win) {
        if(type=='image') {
            $('#editorImage input').click();
        }
    } 

});

```

YOUR DIRECTIVE

```
directive('fileModel', ['$parse', function ($parse) {
    return {
        restrict: 'A',
        link: function(scope, element, attrs) {
            var model = $parse(attrs.fileModel);
            var modelSetter = model.assign;

            element.bind('change', function(){
                scope.$apply(function(){
                    modelSetter(scope, element[0].files[0]);
                    scope.uploadImage();
                });
            });
        }
    };
}]);

```

YOUR CONTROLLER FUNCTION

```
$scope.uploadImage =function (){

    var fd = new FormData();
    fd.append('file', $scope.imageFile);
    $http({
        method:"POST",
        url: URL,
        data: fd,
        timeout:60000,
        transformRequest: angular.identity,
        headers: {'Content-Type': undefined}
    }).success(function(response,status){

    });

}

```
This has worked for me, used @tinymce/angular - angular version 11

In component.html file

```
<editor [id]="'editorID1'" style="margin-left: 0em" [formControlName]="'questiontext'" placeholder="Date"
       class="form-control" apiKey=" place your api key here" [init]="editorConfig">
</editor>

```

It's in ts file:

```
  let editorConfig = {
  paste_data_images: true,

  file_picker_callback: function(callback:any, value:any, meta:any) {
    var input = document.createElement('input');
    input.setAttribute('type', 'file');
    input.setAttribute('accept', 'image/*');
      if (meta.filetype == 'image') {
         input.click();
         // jQuery('#test-upload').trigger('click');
         //   input.on('change', function(e:any) {               
          input.onchange = function (e:any) {
          //jQuery('#test-upload').on('change', function(e:any) {
              var file:any = e.target.files[0];
              var reader = new FileReader();
              reader.onload = function(e: any) {
                  callback(e.target.result, {
                      alt: ''
                  });
              };
              reader.readAsDataURL(file);
          };
      }
  },

...
}

```